Data Tools
Regex Tester
Test regular expressions with real-time matching. Free online tool — runs in your browser, no sign-up required.
See how to use this toolRegex Tester
Data is converted locally in your browser without server upload.
About Regex Tester
Regex Tester evaluates JavaScript regular expressions against your sample text in real time, using the same V8 (or SpiderMonkey/JSC) regex engine your production code uses — not a reimplementation. That matters because regex syntax and behavior differ across engines: lookbehind support, named capture groups, Unicode property escapes (\p{L}), and the semantics of greedy vs lazy quantifiers all vary between JavaScript, Python, and PCRE. Testing against the real engine guarantees the pattern that works here works in your code.
The tool shows match highlights, full match details (index, captured groups, named groups), and a side-by-side view of find-and-replace output. It exposes the flags that actually matter — g global, i case-insensitive, m multiline, s dotAll — plus u for Unicode mode, and explains each in plain language. Common pitfalls surface immediately: a pattern that catastrophically backtracks will visibly hang on adversarial input, so you catch it before shipping.
Everything runs locally in your browser. There is no server to receive your test text, which matters because sample text is often real production data — emails, log lines, or user input you should not paste elsewhere.
How to use it
- 1Type your pattern into the regex field — flags can be set with checkboxes or appended after the closing slash.
- 2Paste your sample text into the test area.
- 3Toggle flags (g, i, m, s, u) and watch matches re-highlight instantly.
- 4Inspect the match list — each entry shows the full match, index, and any captured or named groups.
- 5For replacements, enter a replacement string (with $1, $<name> syntax) and review the output side-by-side.
When to use it
- ✓Building and testing a phone-number extraction pattern before deploying it in production code.
- ✓Crafting a log-line parser that captures timestamp, level, and message into named groups.
- ✓Prototyping a find-and-replace that uses backreferences to reformat dates.
- ✓Diagnosing why a pattern works on regex101 (PCRE) but fails in JavaScript.
Features
- •Real browser regex engine — behavior matches your production JavaScript exactly.
- •Live match highlighting with index, captured groups, and named groups.
- •Flag toggles (g, i, m, s, u) with plain-language explanations.
- •100% local — sample text never leaves your browser.
Related tools
JSON Formatter & Validator
Paste and check JSON syntax, then indent it, sort object keys, or minify the output for copying or download.
SQL Formatter
Format and beautify SQL queries. Free online tool — runs in your browser, no sign-up required.
CSV Viewer
View and preview CSV data in a table. Free online tool — runs in your browser, no sign-up required.
Unix Timestamp Converter
Convert between Unix timestamps and human-readable dates. Free online tool — runs in your browser, no sign-up required.
YAML Validator
Validate and format YAML data. Free online tool — runs in your browser, no sign-up required.
CSV Merge
Combine multiple CSV files into one. Free online tool — runs in your browser, no sign-up required.
CSV Remove Duplicates
Remove duplicate rows from CSV files. Free online tool — runs in your browser, no sign-up required.
CSV Split
Split large CSV files into smaller ones. Free online tool — runs in your browser, no sign-up required.
FAQ
Why does my pattern work on regex101 but fail here?
regex101 defaults to the PCRE2 engine, which supports features JavaScript lacks (possessive quantifiers, recursion, some lookbehind variants). This tool uses the JavaScript engine, so it matches what your code actually runs. Switch regex101 to the JavaScript flavor to confirm.
Does it support named capture groups?
Yes. Use the (?<name>...) syntax (with the u flag for full spec compliance) and the tool displays matches under their group name. In replacements, refer to them with $<name>.
What are the g, i, m, s, u flags?
g finds all matches (not just the first), i is case-insensitive, m makes ^ and $ match line boundaries, s lets . match newlines, and u enables Unicode mode (required for \p{...} property escapes and astral characters).
Is my sample text uploaded?
No. Matching runs entirely in your browser using the native RegExp engine. No text crosses the network, so it is safe for real emails, log lines, and user input.
Can I test find-and-replace with backreferences?
Yes. Enter a replacement string using $1, $2 for numbered groups or $<name> for named groups. The tool shows the original and replaced text side by side.
Why does my pattern hang on certain inputs?
That is catastrophic backtracking — a sign of an ambiguous pattern with nested quantifiers, e.g. (a+)+. The browser engine will visibly stall. Rewrite the pattern (often by making a quantifier possessive or unrolling the group) to remove the ambiguity.