table match object attributes and methods syntax description end(greturns the end position of the match in the text for group if given (or for group the whole match)returns - if the group did not participate in the match endpos the search' end position (the end of the text or the end given to match(or search()returns string with capture markers (\ \ \gand similarreplaced by the corresponding captures expand(sm group(greturns the numbered or named capture group gif more than one is given tuple of corresponding capture groups is returned (the whole match is group groupdictdefaultreturns dictionary of all the named capture groups with the names as keys and the captures as valuesif default is given this is the value used for capture groups that did not participate in the match groupsdefaultreturns tuple of all the capture groups starting from if default is given this is the value used for capture groups that did not participate in the match lastgroup the name of the highest numbered capturing group that matched or none if there isn' one or if no names are used the number of the highest capturing group that matched or none if there isn' one the start position to look from (the start of the text or the start given to match(or search() lastindex pos re the regex object which produced this match object span(greturns the start and end positions of the match in the text for group if given (or for group the whole match)returns (- - if the group did not participate in the match start(greturns the start position of the match in the text for group if given (or for group the whole match)returns - if the group did not participate in the match string the string that was passed to match(or search(name re sub( "(? \ +?(?:\ +\ +?)*) "\ +(? \ +)" "\ \ "namehere we have changed the forenames part of the regex (the first linethe first part of the forenames regex matches one or more word characters optionally followed by period the second part matches at least one whitespace charac