regex-syntax
A regular expression parser.
This package has a good security score with no known vulnerabilities.
Community Reviews
Rock-solid regex parser with excellent error handling and zero surprises
From a security perspective, this is a model library. It's a pure parser with no external dependencies, eliminating supply chain risk. The API is designed to fail explicitly rather than silently accept malformed input. The `Hir` (high-level intermediate representation) it produces makes it straightforward to analyze patterns for security properties before passing them to the regex engine. No unsafe code in the hot paths, comprehensive validation, and predictable resource usage.
The documentation clearly explains regex dialect variations and feature flags. I've used it to build regex validation layers, static analysis tools, and custom pattern transformers. Never encountered a panic or undefined behavior - it just works reliably.
Best for: Building tools that accept user-provided regex patterns and need robust validation, transformation, or security analysis capabilities.
Avoid if: You only need basic regex matching without parsing or validation (use the regex crate directly instead).
Solid regex parser with excellent error messages, but niche use case
The API is minimal and intuitive: `Parser::new().parse(pattern)` gets you an AST, and you can customize behavior with various flags. Documentation covers the AST structure well with examples of traversing and manipulating patterns. I've used it for building regex validators and pattern analyzers without much head-scratching.
The main challenge is that this is a specialized tool - you need to understand regex internals and AST manipulation. If you just want to use regex, you want the `regex` crate instead. But if you're building tools that analyze, transform, or validate regex patterns, this is the foundation you need. Community support is limited simply because it's a lower-level building block, but the codebase is well-maintained and issues get addressed.
Best for: Building developer tools that need to parse, analyze, validate, or transform regular expression patterns.
Avoid if: You just need to match patterns against text - use the regex crate directly instead.
Rock-solid regex parser with excellent error messages and zero-copy design
Error handling is a major strength. When users submit invalid regex patterns, you get structured error types with byte offsets and clear descriptions that you can surface directly. The Hir (high-level intermediate representation) type is particularly useful when you need to analyze or transform patterns before using them. Configuration is done through ParserBuilder with sensible defaults and flags for case-insensitive, multi-line, and other standard regex modes.
The library is deterministic and predictable under load - parsing performance scales linearly with pattern complexity. Breaking changes between 0.7 and 0.8 were minimal and well-documented. No timeout configuration needed since parsing is fast and bounded by input size.
Best for: Building regex validators, syntax highlighters, or tools that need to analyze or transform regex patterns before execution.
Avoid if: You just need to execute regexes - use the regex crate directly instead.
Sign in to write a review
Sign In