💾 Archived View for tris.fyi › pydoc › sre_parse captured on 2023-01-29 at 03:32:57. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-07-16)

🚧 View Differences

-=-=-=-=-=-=-

Back to module index

Go to module by name

sre_parse

Internal support module for sre

Classes

State

checkgroup(self, gid)
checklookbehindgroup(self, gid, source)
closegroup(self, gid, p)
opengroup(self, name=None)
groups = <property object at 0x7f75e3c07150>

SubPattern

append(self, code)
dump(self, level=0)
getwidth(self)
insert(self, index, code)

Tokenizer

error(self, msg, offset=0)
get(self)
getuntil(self, terminator, name)
getwhile(self, n, charset)
match(self, char)
seek(self, index)
tell(self)
pos = <property object at 0x7f75e3c071f0>

Verbose

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

error

Exception raised for invalid regular expressions.

    Attributes:

        msg: The unformatted error message
        pattern: The regular expression pattern
        pos: The index in the pattern where compilation failed (may be None)
        lineno: The line corresponding to pos (may be None)
        colno: The column corresponding to pos (may be None)
    
with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

Functions

expand_template

expand_template(template, match)

fix_flags

fix_flags(src, flags)

parse

parse(str, flags=0, state=None)

parse_template

parse_template(source, state)

Other members

ANY = ANY
ANY_ALL = ANY_ALL
ASCIILETTERS = frozenset({'p', 'u', 't', 'b', 'o', 'e', 'r', 'I', 'k', 'd', 'n', 'B', 'm', 'X', 'f', 'q', 'G', 'M', 'W', 'E', 'U', 'l', 'K', 'O', 'V', 'g', 'J', 'R', 'S', 'x', 'C', 'L', 'Y', 'Z', 'H', 'P', 's', 'a', 'c', 'i', 'T', 'N', 'j', 'v', 'w', 'y', 'F', 'Q', 'A', 'h', 'z', 'D'})
ASSERT = ASSERT
ASSERT_NOT = ASSERT_NOT
AT = AT
ATCODES = [AT_BEGINNING, AT_BEGINNING_LINE, AT_BEGINNING_STRING, AT_BOUNDARY, AT_NON_BOUNDARY, AT_END, AT_END_LINE, AT_END_STRING, AT_LOC_BOUNDARY, AT_LOC_NON_BOUNDARY, AT_UNI_BOUNDARY, AT_UNI_NON_BOUNDARY]
AT_BEGINNING = AT_BEGINNING
AT_BEGINNING_LINE = AT_BEGINNING_LINE
AT_BEGINNING_STRING = AT_BEGINNING_STRING
AT_BOUNDARY = AT_BOUNDARY
AT_END = AT_END
AT_END_LINE = AT_END_LINE
AT_END_STRING = AT_END_STRING
AT_LOCALE = {AT_BOUNDARY: AT_LOC_BOUNDARY, AT_NON_BOUNDARY: AT_LOC_NON_BOUNDARY}
AT_LOC_BOUNDARY = AT_LOC_BOUNDARY
AT_LOC_NON_BOUNDARY = AT_LOC_NON_BOUNDARY
AT_MULTILINE = {AT_BEGINNING: AT_BEGINNING_LINE, AT_END: AT_END_LINE}
AT_NON_BOUNDARY = AT_NON_BOUNDARY
AT_UNICODE = {AT_BOUNDARY: AT_UNI_BOUNDARY, AT_NON_BOUNDARY: AT_UNI_NON_BOUNDARY}
AT_UNI_BOUNDARY = AT_UNI_BOUNDARY
AT_UNI_NON_BOUNDARY = AT_UNI_NON_BOUNDARY
BIGCHARSET = BIGCHARSET
BRANCH = BRANCH
CALL = CALL
CATEGORIES = {'\\A': (AT, AT_BEGINNING_STRING), '\\b': (AT, AT_BOUNDARY), '\\B': (AT, AT_NON_BOUNDARY), '\\d': (IN, [(CATEGORY, CATEGORY_DIGIT)]), '\\D': (IN, [(CATEGORY, CATEGORY_NOT_DIGIT)]), '\\s': (IN, [(CATEGORY, CATEGORY_SPACE)]), '\\S': (IN, [(CATEGORY, CATEGORY_NOT_SPACE)]), '\\w': (IN, [(CATEGORY, CATEGORY_WORD)]), '\\W': (IN, [(CATEGORY, CATEGORY_NOT_WORD)]), '\\Z': (AT, AT_END_STRING)}
CATEGORY = CATEGORY
CATEGORY_DIGIT = CATEGORY_DIGIT
CATEGORY_LINEBREAK = CATEGORY_LINEBREAK
CATEGORY_LOC_NOT_WORD = CATEGORY_LOC_NOT_WORD
CATEGORY_LOC_WORD = CATEGORY_LOC_WORD
CATEGORY_NOT_DIGIT = CATEGORY_NOT_DIGIT
CATEGORY_NOT_LINEBREAK = CATEGORY_NOT_LINEBREAK
CATEGORY_NOT_SPACE = CATEGORY_NOT_SPACE
CATEGORY_NOT_WORD = CATEGORY_NOT_WORD
CATEGORY_SPACE = CATEGORY_SPACE
CATEGORY_UNI_DIGIT = CATEGORY_UNI_DIGIT
CATEGORY_UNI_LINEBREAK = CATEGORY_UNI_LINEBREAK
CATEGORY_UNI_NOT_DIGIT = CATEGORY_UNI_NOT_DIGIT
CATEGORY_UNI_NOT_LINEBREAK = CATEGORY_UNI_NOT_LINEBREAK
CATEGORY_UNI_NOT_SPACE = CATEGORY_UNI_NOT_SPACE
CATEGORY_UNI_NOT_WORD = CATEGORY_UNI_NOT_WORD
CATEGORY_UNI_SPACE = CATEGORY_UNI_SPACE
CATEGORY_UNI_WORD = CATEGORY_UNI_WORD
CATEGORY_WORD = CATEGORY_WORD
CHARSET = CHARSET
CHCODES = [CATEGORY_DIGIT, CATEGORY_NOT_DIGIT, CATEGORY_SPACE, CATEGORY_NOT_SPACE, CATEGORY_WORD, CATEGORY_NOT_WORD, CATEGORY_LINEBREAK, CATEGORY_NOT_LINEBREAK, CATEGORY_LOC_WORD, CATEGORY_LOC_NOT_WORD, CATEGORY_UNI_DIGIT, CATEGORY_UNI_NOT_DIGIT, CATEGORY_UNI_SPACE, CATEGORY_UNI_NOT_SPACE, CATEGORY_UNI_WORD, CATEGORY_UNI_NOT_WORD, CATEGORY_UNI_LINEBREAK, CATEGORY_UNI_NOT_LINEBREAK]
CH_LOCALE = {CATEGORY_DIGIT: CATEGORY_DIGIT, CATEGORY_NOT_DIGIT: CATEGORY_NOT_DIGIT, CATEGORY_SPACE: CATEGORY_SPACE, CATEGORY_NOT_SPACE: CATEGORY_NOT_SPACE, CATEGORY_WORD: CATEGORY_LOC_WORD, CATEGORY_NOT_WORD: CATEGORY_LOC_NOT_WORD, CATEGORY_LINEBREAK: CATEGORY_LINEBREAK, CATEGORY_NOT_LINEBREAK: CATEGORY_NOT_LINEBREAK}
CH_UNICODE = {CATEGORY_DIGIT: CATEGORY_UNI_DIGIT, CATEGORY_NOT_DIGIT: CATEGORY_UNI_NOT_DIGIT, CATEGORY_SPACE: CATEGORY_UNI_SPACE, CATEGORY_NOT_SPACE: CATEGORY_UNI_NOT_SPACE, CATEGORY_WORD: CATEGORY_UNI_WORD, CATEGORY_NOT_WORD: CATEGORY_UNI_NOT_WORD, CATEGORY_LINEBREAK: CATEGORY_UNI_LINEBREAK, CATEGORY_NOT_LINEBREAK: CATEGORY_UNI_NOT_LINEBREAK}
DIGITS = frozenset({'1', '6', '8', '0', '4', '2', '5', '9', '7', '3'})
ESCAPES = {'\\a': (LITERAL, 7), '\\b': (LITERAL, 8), '\\f': (LITERAL, 12), '\\n': (LITERAL, 10), '\\r': (LITERAL, 13), '\\t': (LITERAL, 9), '\\v': (LITERAL, 11), '\\\\': (LITERAL, 92)}
FAILURE = FAILURE
FLAGS = {'i': 2, 'L': 4, 'm': 8, 's': 16, 'x': 64, 'a': 256, 't': 1, 'u': 32}
GLOBAL_FLAGS = 129
GROUPREF = GROUPREF
GROUPREF_EXISTS = GROUPREF_EXISTS
GROUPREF_IGNORE = GROUPREF_IGNORE
GROUPREF_LOC_IGNORE = GROUPREF_LOC_IGNORE
GROUPREF_UNI_IGNORE = GROUPREF_UNI_IGNORE
HEXDIGITS = frozenset({'1', 'b', '4', 'e', 'd', 'B', '7', '6', '8', 'f', 'E', '5', '9', '0', 'C', 'a', '3', 'c', 'F', '2', 'A', 'D'})
IN = IN
INFO = INFO
IN_IGNORE = IN_IGNORE
IN_LOC_IGNORE = IN_LOC_IGNORE
IN_UNI_IGNORE = IN_UNI_IGNORE
JUMP = JUMP
LITERAL = LITERAL
LITERAL_IGNORE = LITERAL_IGNORE
LITERAL_LOC_IGNORE = LITERAL_LOC_IGNORE
LITERAL_UNI_IGNORE = LITERAL_UNI_IGNORE
MAGIC = 20171005
MARK = MARK
MAXGROUPS = 2147483647
MAXREPEAT = MAXREPEAT
MAX_REPEAT = MAX_REPEAT
MAX_UNTIL = MAX_UNTIL
MIN_REPEAT = MIN_REPEAT
MIN_REPEAT_ONE = MIN_REPEAT_ONE
MIN_UNTIL = MIN_UNTIL
NEGATE = NEGATE
NOT_LITERAL = NOT_LITERAL
NOT_LITERAL_IGNORE = NOT_LITERAL_IGNORE
NOT_LITERAL_LOC_IGNORE = NOT_LITERAL_LOC_IGNORE
NOT_LITERAL_UNI_IGNORE = NOT_LITERAL_UNI_IGNORE
OCTDIGITS = frozenset({'1', '6', '0', '4', '2', '5', '7', '3'})
OPCODES = [FAILURE, SUCCESS, ANY, ANY_ALL, ASSERT, ASSERT_NOT, AT, BRANCH, CALL, CATEGORY, CHARSET, BIGCHARSET, GROUPREF, GROUPREF_EXISTS, IN, INFO, JUMP, LITERAL, MARK, MAX_UNTIL, MIN_UNTIL, NOT_LITERAL, NEGATE, RANGE, REPEAT, REPEAT_ONE, SUBPATTERN, MIN_REPEAT_ONE, GROUPREF_IGNORE, IN_IGNORE, LITERAL_IGNORE, NOT_LITERAL_IGNORE, GROUPREF_LOC_IGNORE, IN_LOC_IGNORE, LITERAL_LOC_IGNORE, NOT_LITERAL_LOC_IGNORE, GROUPREF_UNI_IGNORE, IN_UNI_IGNORE, LITERAL_UNI_IGNORE, NOT_LITERAL_UNI_IGNORE, RANGE_UNI_IGNORE]
OP_IGNORE = {LITERAL: LITERAL_IGNORE, NOT_LITERAL: NOT_LITERAL_IGNORE}
OP_LOCALE_IGNORE = {LITERAL: LITERAL_LOC_IGNORE, NOT_LITERAL: NOT_LITERAL_LOC_IGNORE}
OP_UNICODE_IGNORE = {LITERAL: LITERAL_UNI_IGNORE, NOT_LITERAL: NOT_LITERAL_UNI_IGNORE}
RANGE = RANGE
RANGE_UNI_IGNORE = RANGE_UNI_IGNORE
REPEAT = REPEAT
REPEAT_CHARS = '*+?{'
REPEAT_ONE = REPEAT_ONE
SPECIAL_CHARS = '.\\[{()*+?^$|'
SRE_FLAG_ASCII = 256
SRE_FLAG_DEBUG = 128
SRE_FLAG_DOTALL = 16
SRE_FLAG_IGNORECASE = 2
SRE_FLAG_LOCALE = 4
SRE_FLAG_MULTILINE = 8
SRE_FLAG_TEMPLATE = 1
SRE_FLAG_UNICODE = 32
SRE_FLAG_VERBOSE = 64
SRE_INFO_CHARSET = 4
SRE_INFO_LITERAL = 2
SRE_INFO_PREFIX = 1
SUBPATTERN = SUBPATTERN
SUCCESS = SUCCESS
TYPE_FLAGS = 292
WHITESPACE = frozenset({' ', '\r', '\n', '\t', '\x0c', '\x0b'})