FormatAbstract#
- class FormatAbstract(fmt, params)#
Bases:
objectRepresent a format string.
Can generate an appropriate regular expression corresponding to that format string (to some limitations), generate a string from a value, or parse such a string into a value.
Users are not meant to instanciate those objects directly, use
get_format()instead (or its alias for retro-compatibilityFormat()).- Parameters:
- add_outer_alignement(rgx)#
Add necessary regex for alignement characters.
If width is not specified, does nothing.
- generate_expression(capture=False)#
Generate a regular expression matching strings created with this format.
- Parameters:
capture – If true, add capturing groups that will be used to parse the value by selecting only relevant information. Default is false.
- Return type:
- get_fill_regex()#
Return regex for matching fill characters.