Text operation utils¶
-
moulinette.utils.text.
search
(pattern, text, count=0, flags=0)[source]¶ Search for pattern in a text
Scan through text looking for all locations where the regular expression pattern matches, and return them as a list of strings.
The optional argument count is the maximum number of pattern occurences to return; count must be an integer. If omitted or zero, all occurences will be returned. If it’s a negative number, occurences to return will be counted backward. If only one occurence is requested, it will be returned as a string.
The expression’s behaviour can be modified by specifying a flags value. Refer to the re module documentation for available variables.