Regex tester
Test regular expressions with live match highlighting and capture-group inspection. JavaScript regex flavor.
Node.js, browsers, Bun, Deno — The native ECMAScript RegExp engine — what runs in V8/SpiderMonkey/JSC.
Contact [email protected] or [email protected] for details.
§ About this tool
What is a regular expression?
A regular expression (regex) is a small pattern language that describes sets of strings. A pattern is matched against an input to find, validate, or transform text. This tool runs the JavaScript (ECMAScript) flavor of regex — the same engine your browser uses, with the same syntax and the same edge cases.
Regex patterns combine literal characters with character classes, quantifiers, anchors, and groups to describe everything from a phone number to a multi-line log entry. They are concise to write, easy to get wrong, and notoriously hard to debug without a tool that highlights matches and capture groups in place.
How it works
A pattern in JavaScript is delimited by slashes followed by flags — /foo/gi. Common flags are g (find all matches, not just the first), i (case-insensitive), m (multiline — ^ and $ match at line boundaries instead of only the start and end of the input), s (dotall — . matches newlines), u (Unicode mode), and y (sticky).
Inside a pattern, [abc] is a character class, \d is a digit, \b is a word boundary, * + ? and {n,m} are quantifiers, (...) captures a group, and (?:...) groups without capturing. Lookarounds — (?=...), (?!...), (?<=...), (?<!...) — match position, not text.
When to use this tool
- Validating user input formats — email shapes, slugs, postal codes.
- Parsing log lines or CSV-like data for ad-hoc extraction before writing a stricter parser.
- Search-and-replace across a body of text in editors and pipelines.
- Building or testing patterns for a route matcher, a linter rule, or a redaction filter.
- Inspecting capture groups visually before pasting the pattern into application code.
Common pitfalls
- Catastrophic backtracking (ReDoS) — patterns like
(a+)+$or(a|aa)+can take exponential time on long, near-matching inputs and freeze the browser tab. Avoid nested quantifiers on overlapping alternatives. - Greedy versus lazy quantifiers.
.*grabs as much as possible;.*?grabs as little as possible. The wrong choice consumes too much or too little input. $matches before a final newline only with themflag — without it,$binds to the end of input, not the end of a line.- PCRE, .NET, RE2, and ECMAScript all differ. A pattern that works in Perl may not parse in JavaScript and vice versa. Lookbehind support, named groups, and possessive quantifiers especially vary.
.does not match a literal dot. Escape it as\.when you mean the character.
Frequently asked
Does this support PCRE syntax?
No. This tool is the JavaScript flavor only. Features unique to PCRE (recursive patterns, possessive quantifiers, certain Unicode properties) will not parse here. For PCRE testing, use a server-side tester.
How do I match a literal dot?
Escape it: \. matches the character .. Inside a character class, [.] also works because . has no special meaning there.
Why does my regex hang the browser?
Almost always catastrophic backtracking. Look for nested quantifiers applied to overlapping subpatterns and rewrite them. Anchoring the pattern (^ and $) and using non-greedy quantifiers usually helps.
What is the difference between regex and glob?
Globs (*.txt, **/foo) are a much smaller pattern language used by shells and gitignore for filenames. Globs do not support quantifiers, anchors, or capture groups. Regex is a superset in expressive power but heavier syntactically.
How do I make a pattern case-insensitive?
Add the i flag — /foo/i matches FOO, Foo, and foo alike.
JWT decoder
Decode, verify, and encode JSON Web Tokens. All in your browser — nothing leaves the page.
JA4 fingerprint lookup
Search the public FoxIO JA4+ database by fingerprint, application, library, device, or OS.
Base64 / URL / hex
Encode and decode between Base64, URL-percent, and hex. UTF-8 safe round-trips.