re.match(regexp, string) returns None or Match object if a regular expression matches the beginning of the string. re.search(regexp, string) returns None or Match object if regular expression matches anywhere in the string.
Alternatively you can compile regular expression with: regexpObj = re.compile(regexp[,flags]) and use regexpObj.search(string) and regexpObj.match(string).
Match object group() returns part of the string that matched. start() and end() return start/end position of a match within string. span() returns a tuple (start, end) position of a match.