Regular Expression Matching
Matching at the beginning of strings
- Syntax: math_object = re.match(string)
- E.g.
>>> import re
>>> regex = re.compile('key')
>>> match = regex.match("I have a key")
>>> print match
None
>>> match = regex.match("keys open doors")
>>> print match
<_sre.SRE_Match object at 0x009B6068>