- patternError
(message pattern : String)
(pos : String.Pos.Raw)
: ParseError
patternErroris raised when Python'sre.patternErrorexception is raised. Reference: Python's re exceptions:"Exception raised when a string passed to one of the functions here is not a valid regular expression (for example, it might contain unmatched parentheses) or when some other error occurs during compilation or matching. It is never an error if a string contains no match for a pattern."
- unimplemented
(message pattern : String)
(pos : String.Pos.Raw)
: ParseError
unimplementedis raised whenever we don't support some regex operations (e.g., lookahead assertions).
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Regular Expression Nodes
- char : Char → RegexAST
Single literal character:
a - range : Char → Char → RegexAST
Character range:
[a-z] - union : RegexAST → RegexAST → RegexAST
Alternation:
a|b - concat : RegexAST → RegexAST → RegexAST
Concatenation:
ab - anychar : RegexAST
Any character:
. - star : RegexAST → RegexAST
Zero or more:
a* - plus : RegexAST → RegexAST
One or more:
a+ - optional : RegexAST → RegexAST
Zero or one:
a? - loop : RegexAST → Nat → Nat → RegexAST
Bounded repetition:
a{n,m} - anchor_start : RegexAST
Start of string:
^ - anchor_end : RegexAST
End of string:
$ - group : RegexAST → RegexAST
Grouping:
(abc) - empty : RegexAST
Empty string:
()or"" - complement : RegexAST → RegexAST
Complement:
[^a-z]
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Parse character class like [a-z], [0-9], etc. into union of ranges and
chars. Note that this parses | as a character.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parse numeric repeats like {10} or {1,10} into min and max bounds.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parse atom: single element (char, class, anchor, group) with optional
quantifier. Stops at the first |.
Parse explicit group with parentheses.
Parse group: handles alternation and concatenation at current scope.
Parse entire regex string (implicit top-level group).
Equations
- Strata.Python.parseTop s = Except.map (fun (x : Strata.Python.RegexAST × String.Pos.Raw) => match x with | (r, snd) => r) (Strata.Python.parseGroup s 0 none)