Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Public Member Functions | |
def | __init__ |
def | start |
def | end |
def | span |
def | groups |
def | group |
def | groupdict |
Data Fields | |
re | |
string | |
pos | |
endpos | |
regs | |
Holds a compiled regular expression pattern. Methods: start Return the index of the start of a matched substring. end Return the index of the end of a matched substring. span Return a tuple of (start, end) of a matched substring. groups Return a tuple of all the subgroups of the match. group Return one or more subgroups of the match. groupdict Return a dictionary of all the named subgroups of the match.
def end | ( | self, | |
g = 0 |
|||
) |
end([group=0]) -> int or None Return the indices of the end of the substring matched by group; group defaults to zero (meaning the whole matched substring). Return -1 if group exists but did not contribute to the match.
Definition at line 542 of file pre.py.
References MatchObject.regs.
def group | ( | self, | |
groups | |||
) |
group([group1, group2, ...]) -> string or tuple Return one or more subgroups of the match. If there is a single argument, the result is a single string; if there are multiple arguments, the result is a tuple with one item per argument. Without arguments, group1 defaults to zero (i.e. the whole match is returned). If a groupN argument is zero, the corresponding return value is the entire matching string; if it is in the inclusive range [1..99], it is the string matching the the corresponding parenthesized group. If a group number is negative or larger than the number of groups defined in the pattern, an IndexError exception is raised. If a group is contained in a part of the pattern that did not match, the corresponding result is None. If a group is contained in a part of the pattern that matched multiple times, the last match is returned. If the regular expression uses the (?P<name>...) syntax, the groupN arguments may also be strings identifying groups by their group name. If a string argument is not used as a group name in the pattern, an IndexError exception is raised.
Definition at line 592 of file pre.py.
References MatchObject.regs, MatchObject.string, and log_faction_ships.tuple.
def groupdict | ( | self, | |
default = None |
|||
) |
groupdict([default=None]) -> dictionary Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name. The default argument is used for groups that did not participate in the match.
Definition at line 639 of file pre.py.
References MatchObject.regs, and MatchObject.string.
def groups | ( | self, | |
default = None |
|||
) |
groups([default=None]) -> tuple Return a tuple containing all the subgroups of the match, from 1 up to however many groups are in the pattern. The default argument is used for groups that did not participate in the match.
Definition at line 574 of file pre.py.
References MatchObject.regs, MatchObject.string, and log_faction_ships.tuple.
def span | ( | self, | |
g = 0 |
|||
) |
span([group=0]) -> tuple Return the 2-tuple (m.start(group), m.end(group)). Note that if group did not contribute to the match, this is (-1, -1). Group defaults to zero (meaning the whole matched substring).
Definition at line 558 of file pre.py.
References MatchObject.regs.
def start | ( | self, | |
g = 0 |
|||
) |
start([group=0]) -> int or None Return the index of the start of the substring matched by group; group defaults to zero (meaning the whole matched substring). Return -1 if group exists but did not contribute to the match.
Definition at line 526 of file pre.py.
References MatchObject.regs.