Skip to main content

Crate jsonschema_regex

Crate jsonschema_regex 

Source

Enums§

PatternAnalysis
The result of analyzing a regex pattern for literal-match optimizations.

Functions§

analyze_pattern
Analyze a regex pattern and return a PatternAnalysis if a literal optimization applies.
contains_ecma_whitespace
Whether input holds any character \s matches.
is_ecma_whitespace
Returns true for ECMA-262 whitespace characters (\s in ECMA regex): the union of ASCII whitespace, \u{00a0}, and the Unicode space-separator category recognized by the spec.
is_valid_ecma_regex
Whether pattern is a syntactically valid ECMA-262 regular expression under the u flag, or differs from one only by escaping non-alphanumeric characters.
pattern_as_prefix
Try to extract a simple prefix from a pattern like ^prefix. Only matches patterns with alphanumeric characters, hyphens, underscores, and forward slashes. The escaped form \/ is also accepted and normalised to /.
pattern_witness
A string pattern matches, or None where the syntax alone is not enough to build one.
to_rust_regex
Convert ECMA Script 262 regex to Rust regex on the best effort basis.