re.Match.groupdict — a dictionary of named groups
re.Match.groupdict returns a dictionary of named capture groups. Its default parameter supplies the value for groups that did not participate in the match.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
re.Match.groupdict returns a dictionary of named capture groups. Its default parameter supplies the value for groups that did not participate in the match.
A compiled pattern stores the expression and flags and exposes methods for repeated searches.
Scans for the first position at which the pattern matches.
Splits input at regular-expression matches.
Replaces non-overlapping regex matches using a replacement template with group references or a callable.
Returns transformed text together with the number of substitutions performed.
Inserts one hashable object into a set.
Removes every element from the same mutable set.
Creates a set containing members of the first set absent from the other input.
Removes a member if it is present.
Creates a set of members common to the supplied inputs.
Tests whether the set and another iterable have no common member.
Tests whether every member occurs in the other iterable.
Tests whether the receiver contains every member of the other iterable.
Removes and returns an arbitrary set member.
Removes a required member from a set.
Builds the set of members appearing in exactly one of the two inputs.
Creates a set of all members present in either input.
Adds members of an iterable directly to the receiving set.
Makes the first character titlecase and the rest lowercase.
Produces a Unicode case-folded string for caseless comparison.
Counts non-overlapping occurrences of a substring within the selected range.
Encodes Unicode text as bytes in a chosen character encoding.
Tests whether a string ends with a suffix or any suffix in a tuple.