| |
- MatchObject
- RegexObject
- _Dummy
class MatchObject |
|
no doc string |
| |
- __init__(self, re, string, pos, endpos, regs)
- no doc string
- end(self, g=0)
- Return the end of the substring matched by group g
- group(self, *groups)
- Return one or more groups of the match
- groupdict(self, default=None)
- Return a dictionary containing all named subgroups of the match
- groups(self, default=None)
- Return a tuple containing all subgroups of the match object
- span(self, g=0)
- Return (start, end) of the substring matched by group g
- start(self, g=0)
- Return the start of the substring matched by group g
|
class RegexObject |
|
#
# Class definitions
#
|
| |
- __getinitargs__(self)
- # The following 3 functions were contributed by Mike Fletcher, and
- # allow pickling and unpickling of RegexObject instances.
- __getstate__(self)
- no doc string
- __init__(self, pattern, flags, code, groupindex)
- no doc string
- __setstate__(self, statetuple)
- no doc string
- findall(self, source)
- Return a list of all non-overlapping matches in the string.
- If one or more groups are present in the pattern, return a
- list of groups; this will be a list of tuples if the pattern
- has more than one group.
- Empty matches are included in the result.
- match(self, string, pos=0, endpos=None)
- Try to apply the pattern at the start of the string, returning
- a MatchObject instance, or None if no match was found.
- search(self, string, pos=0, endpos=None)
- Scan through string looking for a match to the pattern, returning
- a MatchObject instance, or None if no match was found.
- split(self, source, maxsplit=0)
- Split the source string by the occurrences of the pattern,
- returning a list containing the resulting substrings.
- sub(self, repl, string, count=0)
- Return the string obtained by replacing the leftmost
- non-overlapping occurrences of the pattern in string by the
- replacement repl
- subn(self, repl, source, count=0)
- Return a 2-tuple containing (new_string, number).
- new_string is the string obtained by replacing the leftmost
- non-overlapping occurrences of the pattern in the source
- string by the replacement repl. number is the number of
- substitutions that were made.
|
|