About RegexShelf
RegexShelf is a regex tester and explainer with a small library of tested patterns. It runs your pattern on a real engine in your browser, explains it token by token, and shows where regex flavors disagree.
Why it exists
"Regex" is a family of languages. A pattern that works in JavaScript can be a syntax error in Python, and one that works in PCRE2 can accept a trailing newline that JavaScript rejects. Many testers pick one flavor, or label several and run only one. RegexShelf says plainly which flavors it runs and which it only describes, and every difference it lists names the official page it came from.
Which engines are real
- JavaScript: your browser's own
RegExp. Executed. - PCRE2: PCRE2 10.48, compiled to WebAssembly and used through the open-source npm package
pcre2-wasm10.48.0 (MIT licence; the bundled PCRE2 library is under the BSD 3-clause licence with the PCRE2 exception). Executed. - Go: the Go 1.24 standard library
regexppackage compiled to WebAssembly with Go's own toolchain (BSD 3-clause licence). Executed. It uses RE2 syntax and has the same linear-time promise, but it is Go's implementation, not Google's RE2 library, so the site calls it "Go regexp". - Python, Java and RE2: notes only, not executed. Their entries come from their official documentation, plus a few single runs on Python 3.13.5 and JDK 17 that are marked "observed".
The full licence texts for these components are in third-party-licenses.txt. The Go engine is rebuilt from source in this project with the build script engines/go/build.sh.
Everything runs in your browser
Matching runs in a Web Worker with a time limit: if a pattern does not finish, the page terminates the Worker and tells you, instead of freezing. The pattern, text and replacement are not sent to a server. Pages are static files; there is no back end that receives your input. The details, including the single value the site stores in your browser's local storage, are in the Privacy Policy.
How the results were checked
- Hand-derived tests. The expected values in the automated tests and in the worked examples (match positions, replacement outputs, every row of the pattern tables) were worked out by hand from the pattern and the cited standard first, and only then compared with the engines. The pages print those same checked values.
- Independent checks. For example, the ISO date pattern was compared with a calendar routine over 2,501 years, the IPv4 pattern with a numeric parser for every octet value from 0 to 300, and the semantic-version pattern with every example in the specification.
- Documentation for the rest. Statements about flavors that are not executed come from their official documentation. Where the documentation does not settle a point, the page says "unclear".
Where it is unsure
Every table cell is marked documented (stated by the official page), observed (we ran the real engine and saw it) or unclear. Every page ends with the official documents it relied on, with links and the date they were read. If something disagrees with your real engine, please tell us with the pattern, the flavor and version, the text and what you saw; that is the most useful kind of correction.
Who runs it
RegexShelf, an independent project operated from Indonesia. You can reach us by email at joe@zona13.net.
Cost and advertising
The site is free. It currently shows no advertising and sets no advertising cookies. If that ever changes, the Privacy Policy and this page will be updated before it does.
What it is not
It is not a validator for your application, and it does not run your code. Treat its output as a well-checked second opinion and confirm anything important in the engine and version that will actually run the pattern. See the terms and disclaimer.