-
Scan through string looking for the first location where the regular expression pattern produces a match, and return a corresponding
MatchObject
instance. ReturnNone
if no position in the string matches the pattern; note that this is different from finding a zero-length match at some point in the string.
re.
search
(pattern, string, flags=0)¶
-
If zero or more characters at the beginning of string match the regular expression pattern, return a corresponding
MatchObject
instance. ReturnNone
if the string does not match the pattern; note that this is different from a zero-length match. -
For example:
-
https://docs.python.org/2/library/re.html#search-vs-match
re.
match
(
pattern,
string,
flags=0
)