Skip to main content

Module regex

Module regex 

Source
Expand description

Regular expressions.

Structs§

CharacterClassCounter 🔒
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§

RegexCompilationError
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 Regex crate’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 Regex crate promises that using its size_limit option (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, or None if it does not parse.