Skip to main content

Module lookaround

Module lookaround 

Source
Expand description

Trailing regex lookaround assertions in format type tails (issue #9 / parse#209).

Functions§

parse_lookaround_tail
Parse tail into concatenated lookbehind and lookahead fragments (order preserved). Each segment must be a single non-capturing lookaround group with no capturing groups inside.
reject_lookaround_in_strftime
If type_str is a strftime tail (%… but not exactly %), reject when lookarounds are present.
rewrite_field_fragments_for_engine_anchor
fancy-regex 0.14 does not match some anchored patterns that combine ^ / $ with positive lookbehind at the start or positive lookahead before the end anchor. For literal-only bodies, rewrite those assertions to non-capturing groups so spans stay on the field capture and full-string parse still works.
split_type_base_and_lookaround_tail
Split type_str into the type token(s) and any trailing (?=…) / (?!…) / (?<=…) / (?<!…).