Which regex flags does this tester support?
This tester supports global (g), case-insensitive (i), multiline (m), and dotAll (s) flags.
Free online regex tester to test regular expressions against any text. Highlights all matches, shows match count, groups, and index positions instantly.
If this tool isn’t working as expected, please take a screenshot of the error and report the problem here so we can investigate and improve it.
JavaScript regex has quirks that PCRE-flavored testers won't surface by default - no atomic groups, no possessive quantifiers, and its own flag set. Testing in the actual JS engine before shipping means fewer production surprises.
This runs the JavaScript RegExp engine - the same one your browser uses. If your regex passes here, it passes in production JS code. Useful for testing patterns before embedding them in validators or parsers, and for debugging when a pattern works in a PCRE tester but not in your JavaScript.
Type your regex pattern and select the flags you need.
Add the string you want to test the pattern against.
Matching text is highlighted and match details appear below.
Check match count, index positions, and capture groups.
Test an email or phone validation regex before adding it to a form.
Debug a pattern that matches too much or too little.
Inspect capture group values from a string parser.
Verify flag behavior across global, case-insensitive, multiline, and dotAll modes.
Best For
Pattern & Test Text
Pattern: <.+> (greedy) · Test text: <a><b>Matches
Match 1: <a><b> (index 0) - a single greedy match.
Switching to <.+?> (lazy) instead finds:
Match 1: <a> (index 0)
Match 2: <b> (index 3)Greedy quantifiers (+, *, {n,}) match as much text as possible; lazy quantifiers (+?, *?) match as little as possible. Add a ? after the quantifier to switch a pattern from greedy to lazy.
Pattern & Test Text
Pattern: (\d{4})-(\d{2})-(\d{2}) · Test text: 2026-07-12Match Details
Match 1: 2026-07-12 (index 0)
Group 1: 2026
Group 2: 07
Group 3: 12Each parenthesized group in the pattern becomes a numbered group in Match Details, in the order the opening parentheses appear - this includes named groups like (?<year>\d{4}), which still show up as "Group 1" rather than by their name.
Pattern & Flags
Pattern: a.b · Test text: "a" + newline + "b"Result
Without the s flag: "No matches found for this pattern in the test text."
With the s flag enabled: Match 1: a\nb (index 0)By default, . doesn't match line-break characters. Turning on the s (DotAll) flag makes . match \n too, so the same pattern then matches across the line break.
Confirm a regex that works in another language or tool actually matches under the real JS RegExp engine, before shipping it in a validator or parser.
Use capture groups to pull dates, IDs, or other structured pieces out of a larger string, and inspect exactly what each group captured in the Match Details panel.
Toggle Global, Case Insensitive, Multiline, or DotAll on the same pattern and text to see the effect immediately, instead of guessing from documentation.
Confirm a pattern's match count and capture groups are correct on realistic test text before wiring it into a validator, parser, or form.
Problem
Solution
Only four flags are supported: Global (g), Case insensitive (i), Multiline (m), and DotAll (s). Unicode (u), sticky (y), indices (d), and unicodeSets (v) aren't offered as toggles here.
Problem
Solution
A pattern like (?<year>\d{4}) still labels its result "Group 1" in the Match Details panel, not "year" - named groups work for matching, but the tool doesn't display the name, only the position.
Problem
Solution
The tool always searches with the Global flag internally to build the highlighted view and match list, even if you haven't toggled it on. If you copy the pattern into your own code without Global, remember it will only find the first match there.
Problem
Solution
A pattern like <.+> against <a><b> matches the whole string in one greedy result, not two separate tags - add a ? after the quantifier (<.+?>) to match as little as possible instead.
The tool searches globally either way, but turning Global on in the UI keeps the displayed flag string honest about what you're about to copy elsewhere.
*, +, and {n,} match greedily by default. Appending ? (*?, +?) makes them match the shortest possible string instead - useful when a pattern is grabbing more text than expected.
Try empty strings, multiline text, and text containing the characters your pattern is meant to exclude - the highlighted view makes over-matching and under-matching obvious at a glance.
Unicode (u), sticky (y), indices (d), and unicodeSets (v) flags aren't available as toggles, even though the underlying JavaScript engine supports them.
If a pattern matches more than 500 times in the test text, the tool stops collecting results after the 500th match rather than processing the rest.
The tool only shows matches and capture groups - there's no way to preview a String.replace() or String.split() result using the pattern.
Match Details labels every group "Group 1", "Group 2", and so on by order, even for named groups like (?<year>\d{4}) - the group's captured value shows, but not its name.
This tool always runs the real JavaScript engine. Many general-purpose regex testers default to PCRE, which handles a few constructs differently - the most common source of a pattern that "works" elsewhere but fails here.
| JavaScript (this tool) | PCRE (common tester default) | |
|---|---|---|
| Atomic groups (?>...) | Not supported | Supported |
| Possessive quantifiers (++, *+) | Not supported | Supported |
| Lookbehind (?<=...) | Supported in modern engines (variable-length) | Supported, with behavior that varies by PCRE version |
Which should you use?
A pattern built around atomic groups or possessive quantifiers needs rewriting for JavaScript - there's no direct substitute. Testing here instead of a PCRE-default tool catches that mismatch before it reaches production code.
The most common debugging question is why a regex that worked elsewhere fails in JavaScript. The FAQ below covers which flags are supported, how capture groups are shown, and which regex engine this uses.
This tester supports global (g), case-insensitive (i), multiline (m), and dotAll (s) flags.
Yes. Each match card shows the full match, its start index, and any named or indexed capture groups.
It uses the JavaScript built-in RegExp engine - perfect for testing patterns used in Node.js, browsers, and TypeScript.
Leave your email so we can prioritize similar tools and updates.
Trending tools will appear as visitors explore the catalog.
Your recently visited tools will show up here.