hydra.print.posix.regex module

Per-dialect printer rendering the hydra.regex AST into POSIX ERE syntax (Haskell Text.Regex.TDFA, Scheme Guile (ice-9 regex)). Differs from the canonical hydra.print.regex in one place: Hydra’s . (any character INCLUDING newline) renders as the explicit full-code-point-range class [<U+0000>-<U+10FFFF>], because POSIX ERE’s native . excludes newline and POSIX ERE does not support the s / S shorthands (confirmed by TDFA probe). All other productions are native POSIX ERE. See docs/specification/regex.md and issue #567.

hydra.print.posix.regex.alternation(alt: Sequence[Sequence[Quantified]]) str

Render an alternation, joining its branches with the | operator.

hydra.print.posix.regex.any_class() str

The POSIX ERE rendering of Hydra’s . (any character incl. newline): an explicit character-class range spanning the whole Unicode scalar range, which POSIX ERE engines match literally.

hydra.print.posix.regex.atom(a: Atom) str

Render a single atom; . renders as the explicit full-code-point-range class (POSIX-safe).

hydra.print.posix.regex.character_class(cc: CharacterClass) str

Render a character class, including the leading ^ for a negated class.

hydra.print.posix.regex.class_item(item: ClassItem) str

Render one character-class member (a single character or an inclusive range).

hydra.print.posix.regex.escape_class_char(c: int) str

Render a code point inside a character class, uniformly escaping the class metacharacters ] ^ -.

hydra.print.posix.regex.escape_literal(c: int) str

Render a literal code point in top-level context, backslash-escaping POSIX ERE metacharacters.

hydra.print.posix.regex.print_code_point(c: int) str

Render a single Unicode code point as a one-character string.

hydra.print.posix.regex.print_regex(r: Sequence[Sequence[Quantified]]) str

Render a hydra.regex AST into POSIX ERE syntax. Identical to the canonical printer except that . (any incl. newline) becomes the explicit full-code-point-range class.

hydra.print.posix.regex.quantified(qa: Quantified) str

Render an atom followed by its quantifier suffix.

hydra.print.posix.regex.quantifier(q: Quantifier) str

Render a quantifier suffix; the ‘one’ quantifier renders as the empty string.

hydra.print.posix.regex.regex_sequence(s: Sequence[Quantified]) str

Render a sequence of quantified atoms by concatenation.