PlasmaCalcs.quantities.quantity_tools.Pattern

class PlasmaCalcs.quantities.quantity_tools.Pattern(pattern)

Bases: object

stores re.Pattern and represents it nicely. Use self.pattern to get re.Pattern object.
Use self.str to get str object.
Intended to be used in an immutable way; don’t change pattern or str after creating.
pattern: str or re.Pattern object
will be compiled to re.Pattern object if str.
__init__(pattern)

Methods

__init__(pattern)

fullmatch(s, *args_fullmatch, **kw_fullmatch)

match(s, *args_match, **kw_match)

fullmatch(s, *args_fullmatch, **kw_fullmatch)
returns self.pattern.fullmatch(s, *args, **kw). Equivalent to re.fullmatch(self.pattern, s, …).
match(s, *args_match, **kw_match)
returns self.pattern.match(s, *args, **kw). Equivalent to re.match(self.pattern, s, …).