Skip to main content

Module pattern

Module pattern 

Source
Expand description

Parser module for formatparse-core Parse format patterns into regex strings and field specifications (pure Rust).

Constants§

MAX_NESTED_FORMAT_DEPTH
Maximum recursive depth when compiling nested format patterns (GitHub issue #12).

Functions§

field_types_match
Check if two field types match (for repeated name validation)
normalize_field_name
Normalize field name for use inside (?P<name>...) capture groups.
parse_field
Parse a single field specification from the pattern
parse_field_path
Parse a field name into a path (for dict-style names like “hello[world]” -> [“hello”, “world”])
parse_format_spec
Parse format specifier string into FieldSpec
parse_pattern
Parse a format pattern string into regex parts, field specs, and names allow_empty_delimited_default_string: when false, default string fields always use .+? (used for the unanchored search regex so search/findall do not stop early).
validate_multiline_mvp
Reject :ml / :blk combined with numeric-only format specifiers (GitHub issues #8, #69, #70).

Type Aliases§

ParsedPatternParts
Result tuple from parse_pattern: compiled pattern string, search regex string, field specs, original and normalized field names, normalized-to-original name map, and whether "" may match when every field is a default unconstrained string.