returns tuple of all groupssubstrings of the match (for group numbers and highergroupdict(returns dictionary containing all named groups of the match (see (?prsyntax aheadstart([group]end([group]indices of the start and end of the substring matched by group (or the entire matched stringif no group is passedspan([group]returns the two-item tuple(start(group)end(group)expand([template]performs backslash group substitutionssee the python library manual regular expression patterns regular expression strings are built up by concatenating single-character regular expression formsshown in table - the longest-matching string is usually matched by each formexcept for the nongreedy operators in the tabler means any regular expression formc is characterand denotes digit table - re pattern syntax operator interpretation matches any character (including newline if dotall flag is specified or (?sat pattern frontmatches start of the string (of every line in multiline modematches end of the string (of every line in multiline modec any nonspecial (or backslash-escapedcharacter matches itself rzero or more of preceding regular expression (as many as possiblerone or more of preceding regular expression (as many as possiblerzero or one occurrence of preceding regular expression (optionalr{mmatches exactly copies preceding ra{ matches 'aaaaar{ ,nmatches from to repetitions of preceding regular expression *? +? ?? { , }same as *+and but matches as few characters/times as possiblethese are known as nongreedy match operators (unlike othersthey match and consume as few characters as possibledefines character sete [ -za-zto match all letters (alternativeswith for ranges[defines complemented character setmatches if char is not in set escapes special chars ( *?+|()and introduces special sequences in table - \matches literal (write as \\\in patternor use '\\'\ matches the contents of the group of the same number '+\ matches " regular expression pattern matching