Version 2.1.0
This is a full rewrite of the regex compiler in Rust (from Typescript) to support a very broad class of regex syntax. It has been audited once by zksecurity. You can see the report on https://www.zksecurity.xyz/reports/zkemail . Note that zkregex.com is not yet up to date and is still on version 1.2.
We have added:
- wasm bindings
- an enormous, 100+ test suite to ensure it works for a wide variety of regexes, including dollars, carets, negation, dollars, and international characters
Look at packages/compilers
for installation and running instructions.
The regular expressions supported by this compiler have the following limitations:
- Regular expressions where the results differ between greedy and lazy matching (e.g., .+, .+?) are not supported.
- The beginning anchor ^ must either appear at the beginning of the regular expression or be in the format (|^). Additionally, the section containing this ^ must be non-public (
is_public: false
). - The end anchor $ must appear at the end of the regular expression.
- Regular expressions that, when converted to DFA (Deterministic Finite Automaton), include transitions to the initial state are not supported (e.g., .*).
- Regular expressions that, when converted to DFA, have multiple accepting states are not supported.
Full Changelog: 1.1.0...2.1.0