Expand description
Regular expressions.
Structs§
- Character
Class 🔒Counter - Counts the character classes in an AST, the node kinds whose translated size is not bounded by the pattern bytes that spell them.
- Regex
- A hashable, comparable, and serializable regular expression type.
Enums§
- Regex
Compilation Error - Error type for regex compilation failures.
Constants§
- MAX_
REGEX_ 🔒CHARACTER_ CLASSES - The maximum number of character classes a pattern may contain.
- MAX_
REGEX_ 🔒SIZE_ AFTER_ COMPILATION - The maximum size of a regex after compilation.
This is the same as the
Regexcrate’s default at the time of writing. - MAX_
REGEX_ 🔒SIZE_ BEFORE_ COMPILATION - We also need a separate limit for the size of regexes before compilation. Even though the
Regexcrate promises that using itssize_limitoption (which we set to the other limit,MAX_REGEX_SIZE_AFTER_COMPILATION) would prevent excessive resource usage, this doesn’t seem to be the case. Since we compile regexes in envd, we need strict limits to prevent envd OOMs. See https://github.com/MaterializeInc/database-issues/issues/9907 for an example.
Functions§
- count_
character_ 🔒classes - Counts the character classes in
pattern, orNoneif it does not parse.