Live regex matcher with capture groups. A regexp tester that stays offline.

Flags: g i m s u y d. Global is added automatically so every match is listed.

Matches

Enter a pattern to see matches.

Private ● Runs entirely on your device Runs entirely on your device. Nothing is uploaded.No account required.Nothing stored unless you choose to save it.
▸ More about

Uses of regex tester

  • Debugging a validation pattern before shipping it
  • Checking that named groups capture the right slices of a log line
  • Previewing a bulk replace before editing a document
  • Learning how flags like m, s, and u change matching

regex tester pitfalls

  • Reading a green match count and skipping empty capture groups
  • Pasting a PCRE-only construct and expecting JavaScript to accept it
  • Shipping a nested-quantifier pattern that hangs on crafted input

regex tester questions (10)

How do I test a regular expression online?

Paste a pattern into the Pattern field, add flags such as g or i, and put sample text in the Test text box. Matches appear instantly with their indices and capture groups. Use the optional Replace field to preview substitutions with $1 or named groups.

Which regex flavour does this tester use?

JavaScript RegExp, the same engine your browser runs. Patterns behave like they would in Node or front-end code: lookbehind, named groups, and flags such as s, u, and d are available when the browser supports them.

What do the match indices mean?

Each match shows a start…end span in the test text, counted in UTF-16 code units (JavaScript string indices). Match #1 at [4…7] means characters starting at index 4 up to, but not including, index 7. Capture groups list the substring each group held, or undefined when that group did not participate.

Can I use named capture groups?

Yes. Write (?<word>\w+) in the pattern, then read $<word> in the replace field or inspect the group list under each match. Unnamed groups still appear as group 1, group 2, and so on.

What happens if my regex is invalid?

The tool shows the engine error under the pattern field, for example an unclosed parenthesis or an unknown flag. Matches stay empty until the pattern compiles. Nothing is guessed or silently rewritten.

Why was my pattern blocked as expensive?

Some shapes such as (a+)+ or (a|ab)+ can trigger catastrophic backtracking and freeze a tab. The tester refuses those shapes up front and also stops any run that exceeds a short time budget. Rewrite the pattern with tighter classes or fewer nested quantifiers.

Is there a limit on test text size?

Yes. Test text is capped at about 20,000 characters so a huge paste cannot stall the page. A short notice appears when the cap applies. For larger corpora, slice a representative sample.

How is this different from Find and Replace?

Find and Replace edits a document: it swaps matches and shows a live count. Regex Tester is for understanding a pattern: it lists every match, explains groups, and only optionally previews a replace. Use Find and Replace when you want the edited text; use Regex Tester when you are debugging the expression itself.

Does the global flag matter here?

The tester adds g automatically when it is missing so every match can be listed. Sticky (y) stays sticky. Other flags (i, m, s, u, d) are passed through unchanged.

Is my text uploaded?

No. Matching and replace both run in your browser. Runs entirely on your device. Nothing is uploaded.

How to Test a Regular Expression Online All Developer Utilities