Module safe_regex_compiler::parser [−][src]
Expand description
A parser for regular expressions.
Features
- Provides a
parse
function that converts a regular expression string into aFinalNode
struct which is the root of an abstract syntax tree - Implements a straightforward contex-free grammar parser
- Parses in a single pass
- No recursion, no risk of stack overflow
forbid(unsafe)
- Depends only on
std
- Good test coverage (92%)
Limitations
- Parses only raw byte strings,
br"..."
. - Allocates. Uses
Vec
andString
.
Alternatives
regex-syntax
- Mature
- Popular
- Maintained by the core Rust language developers
- Full of features
regular-expression
- No documentation
Enums
ClassItem | An element of a regular expression character class. |
FinalNode | A completely parsed element of a regular expression abstract syntax tree (AST). |
Node | An AST node used during parsing. |
NonFinalNode | AST nodes used internally during parsing. |
Functions
parse | Parses |