https://stackoverflow.com/questions/180986/what-is-the-difference-between-pythons-re-search-and-re-match
https://stackoverflow.com/questions/13423624/extract-string-with-python-re-match
basic regular expression use:
re.match("ab", "abc").group()
Note that
match
may differ from search
even when using a regular expression beginning with '^'
: '^'
matches only at the start of the string, or in MULTILINE
mode also immediately following a newline. The “match
” operation succeeds only if the pattern matches at the start of the string regardless of mode, or at the starting position given by the optional pos
argument regardless of whether a newline precedes it.# match is faster: it always/only searches from the beginning of a string. This fixed criteria makes the search faster.
No comments:
Post a Comment