ruxox
Start
Start
RegExp

Regex Tester

Test JavaScript regular expressions against sample text in your browser. See every match, index, and capture group instantly. No signup.

Regex Tester

Runs entirely in your browser — no server calls, no tracking.

Enter a pattern and sample text, then click Test regex.

🔒 Your data never leaves this tab. This tool has no backend.

About this tool

About the Regex Tester

A regex tester runs a JavaScript RegExp against any text you paste and instantly shows every match, its start index, and any named or numbered capture groups. Use it to validate route patterns, test data-extraction rules before committing to code, or debug why a filter is matching too broadly or too narrowly.

How to use this tool

Paste your regular expression into the Pattern field, optionally set flags (g for global, i for case-insensitive, m for multiline), then paste sample text. Results update live as you type. The output shows each match with its zero-based index so you can map results back to your source string.

Common patterns

Route parameters: /users/([a-zA-Z0-9_-]+). Email addresses: [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}. ISO dates: \d{4}-\d{2}-\d{2}. Slug validation: ^[a-z0-9]+(-[a-z0-9]+)*$. These are starting points — always test against real production data before shipping.

JavaScript uses Perl-compatible regex with some differences: no lookbehind in older engines, no possessive quantifiers, and \d does not match Unicode digits unless you use the u flag. Test in this tool with the same JS engine your app uses to avoid cross-environment surprises.

FAQ

Frequently asked questions

What regex flags does JavaScript support?
g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dotAll — dot matches newlines), u (unicode), d (indices — adds start/end index per capture), y (sticky). Combine them freely: gim.
Why does my pattern match in this tester but not in my app?
The most common cause is a missing g flag — without it, matchAll will throw. Another cause: your app escapes backslashes differently in string literals (\\d vs \d). Always compare how the pattern is constructed in code vs what you type here.
How do I test a regex without consuming the match?
Use a lookahead: (?=pattern) asserts the pattern exists ahead without including it in the match. Use a lookbehind (?<=pattern) to assert what precedes. This tool shows zero-length matches at their position in the text.
Does this tool support named capture groups?
Yes — JavaScript supports named captures with (?<name>...) syntax. The output shows capture groups by index; named groups can be accessed as m.groups.name in your code.
Custom software

Need production-grade custom software?

ruxox builds web apps, APIs, and automation tools for growing businesses. Free estimate in 48 hours.