class documentation
class Scanner: (source)
Simple scanner All method patterns are regular expression strings (not compiled expressions!)
Method | __init__ |
:param text: The text which should be scanned :param flags: default regular expression flags |
Method | __repr__ |
Undocumented |
Method | check |
Apply `pattern` on the current position and return the match object. (Doesn't touch pos). Use this for lookahead. |
Method | eos |
`True` if the scanner reached the end of text. |
Method | get |
Scan exactly one char. |
Method | scan |
Scan the text for the given pattern and update pos/match and related fields. The return value is a boolean that indicates if the pattern matched. The matched value is stored on the instance as ``match``, the last value is stored as ``last``... |
Method | test |
Apply a pattern on the current position and check if it patches. Doesn't touch pos. |
Instance Variable | data |
Undocumented |
Instance Variable | data |
Undocumented |
Instance Variable | flags |
Undocumented |
Instance Variable | last |
Undocumented |
Instance Variable | match |
Undocumented |
Instance Variable | pos |
Undocumented |
Instance Variable | start |
Undocumented |
Instance Variable | _re |
Undocumented |
Apply `pattern` on the current position and return the match object. (Doesn't touch pos). Use this for lookahead.
Scan the text for the given pattern and update pos/match and related fields. The return value is a boolean that indicates if the pattern matched. The matched value is stored on the instance as ``match``, the last value is stored as ``last``. ``start_pos`` is the position of the pointer before the pattern was matched, ``pos`` is the end position.