FAQ
Why not build our own parser?
Regex flavors use different syntax, flags, Unicode rules, and validation. A shared grammar does not cover these differences without flavor-specific logic.
Is it production-ready?
Yes. regex101 uses it for live parsing and explanations.
What does a parse return?
Each parse returns typed tokens, parser state, and a patternError status. Tokens include source
positions, match-width metadata, relationships, and typed errors.
Does it support incremental parsing?
No. Each uncached call parses the full input in linear time. The parser does not preserve an incremental syntax tree between edits.
Does parseSubstitution apply the substitution?
No. It parses and validates the substitution string. Your regex engine must match the pattern and apply the substitution.
Is AST documentation available?
The package exports TypeScript unions for regex and substitution tokens. The generated type definitions are the current schema reference.
Does it include linting?
No. The parser reports syntax errors. It does not report style problems or assess ReDoS risk.
Does a valid parse guarantee that the engine accepts the pattern?
No. The parser tracks the syntax rules of each flavor, but it does not compile or run the pattern. The target engine remains the source of truth.
Can it be used in browser and Node.js?
Yes. It supports both runtimes and includes ESM and CommonJS builds.