Test JavaScript Regex Online
Enter a pattern and flags, then see matches highlighted in real time with capture groups and indices. Built on the JavaScript RegExp engine for accurate results.
Regex Tester
LOCAL · Browser-OnlyTest and debug regular expressions with live matching and highlights
Quick Start
- 1Type your regex pattern in the pattern field
- 2Toggle flags like g, i, m, and s
- 3Paste your test string below
- 4Review highlighted matches and capture groups
What This Tool Does
Pattern, flags and test string sit across the top and the matches appear underneath. Every match is shown with its position, the exact text it matched, and its capture groups, with named groups listed separately from the numbered ones.
Five tabs share the same pattern. Matches is the default. Replace applies a substitution with clickable helpers for the dollar-sign references. Explain breaks the pattern down token by token in plain English. Code Generator emits the equivalent pattern for eight languages. Tests lets you list inputs that should and should not match and shows each one passing or failing.
All seven JavaScript flags are available, including the indices flag that reports the start and end position of every capture group. Fourteen presets come with sample text attached, so opening the email or UUID preset gives you something to match against straight away.
Limits Worth Knowing
- The engine is the browser's own regular expression engine, so what you see here is what your JavaScript will do.
- A pattern that runs longer than about a second and a half is stopped and reported as a likely runaway rather than freezing the page.
- A check warns about nested quantifiers that can cause runaway backtracking. It is advisory and blocks nothing.
- There is no split mode. Matching and replacing are the two operations.
- Patterns and test strings are kept locally, so they are still there when you come back.
Common Questions
Will these results match my server code?
What does the d flag do?
Can I check a pattern against several inputs at once?
More Test Tools
All testers →Test Regex Find and Replace Online
Test regex find and replace with live output. Free online regex replace tool supporting $1 capture group references and named groups, no signup.
Test Website Load Time and TTFB
Test how fast a website loads, including time to first byte, page size, and request count. Free website speed test with optimization tips, no signup.
Test Webhooks Online - Inspect HTTP Requests
Generate a temporary webhook URL and inspect incoming HTTP requests. Free online webhook tester.
Looking for FAQs and advanced options? Visit the full Regex Tester page →