Token for matching words composed of allowed character sets. Defined
with string containing all allowed initial characters, an optional string
containing allowed body characters (if omitted, defaults to the initial
character set), and an optional minimum, maximum, and/or exact length.
The default value for min is 1 (a minimum value < 1 is not valid); the
default values for max and exact are 0, meaning no maximum or exact
length restriction.
|
__init__(self,
initChars,
bodyChars=None,
min=1,
max=0,
exact=0,
asKeyword=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|
|
|
|
__add__(self,
other)
Implementation of + operator - returns And |
source code
|
|
|
__and__(self,
other)
Implementation of & operator - returns Each |
source code
|
|
|
|
|
|
|
|
|
|
|
__invert__(self)
Implementation of ~ operator - returns NotAny |
source code
|
|
|
|
|
|
|
__or__(self,
other)
Implementation of | operator - returns MatchFirst |
source code
|
|
|
__radd__(self,
other)
Implementation of + operator when left operand is not a ParserElement |
source code
|
|
|
__rand__(self,
other)
Implementation of & operator when left operand is not a
ParserElement |
source code
|
|
|
|
|
|
|
|
|
|
|
__ror__(self,
other)
Implementation of | operator when left operand is not a ParserElement |
source code
|
|
|
__rsub__(self,
other)
Implementation of - operator when left operand is not a ParserElement |
source code
|
|
|
__rxor__(self,
other)
Implementation of ^ operator when left operand is not a ParserElement |
source code
|
|
|
__sub__(self,
other)
Implementation of - operator, returns And with error stop |
source code
|
|
|
__xor__(self,
other)
Implementation of ^ operator - returns Or |
source code
|
|
|
_parse(self,
instring,
loc,
doActions=True,
callPreParse=True) |
source code
|
|
|
_parseCache(self,
instring,
loc,
doActions=True,
callPreParse=True) |
source code
|
|
|
_parseNoCache(self,
instring,
loc,
doActions=True,
callPreParse=True) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
ignore(self,
other)
Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or
other ignorable patterns. |
source code
|
|
|
leaveWhitespace(self)
Disables the skipping of whitespace before matching the characters in
the ParserElement's defined pattern. |
source code
|
|
|
parseFile(self,
file_or_filename,
parseAll=False)
Execute the parse expression on the given file or filename. |
source code
|
|
|
|
|
|
|
|
|
|
|
scanString(self,
instring,
maxMatches=2147483647)
Scan the input string for expression matches. |
source code
|
|
|
searchString(self,
instring,
maxMatches=2147483647)
Another extension to scanString, simplifying the access to the tokens
found to match the given parse expression. |
source code
|
|
|
setBreak(self,
breakFlag=True)
Method to invoke the Python pdb debugger when this element is about
to be parsed. |
source code
|
|
|
setDebug(self,
flag=True)
Enable display of debugging messages while doing pattern matching. |
source code
|
|
|
setDebugActions(self,
startAction,
successAction,
exceptionAction)
Enable display of debugging messages while doing pattern matching. |
source code
|
|
|
|
|
setParseAction(self,
*fns,
**kwargs)
Define action to perform when successfully matching parse element
definition. |
source code
|
|
|
setResultsName(self,
name,
listAllMatches=False)
Define name for referencing matching tokens as a nested attribute of
the returned parse results. |
source code
|
|
|
setWhitespaceChars(self,
chars)
Overrides the default whitespace chars |
source code
|
|
|
|
|
suppress(self)
Suppresses the output of this ParserElement; useful to keep
punctuation from cluttering up returned output. |
source code
|
|
|
transformString(self,
instring)
Extension to scanString, to modify matching text with modified tokens
that may be returned from a parse action. |
source code
|
|
|
|
|
validate(self,
validateTrace=[ ] )
Check defined expressions for valid structure, check for infinite
recursive definitions. |
source code
|
|