Regex Tester

Test regular expressions with flags and see matches instantly. Runs in your browser.

Shortcuts

Cmd/Ctrl+Enter: Run

Cmd/Ctrl+L: Focus pattern

Esc: Clear selection

Ready
Quick recipes:

Matches: 0 (none)

Regex literal: / / · Time: 0.0 ms

Matches

Highlighted text

1
No matches yet.

Replace tester

Supports $1 and $<name>

Replacement output preview appears here.

Split tester

Split results appear here.

Explain mode

Toggle on to see a quick token breakdown of the regex.

Test cases

Case #1

Status: No regex

How to use

  1. Enter a regex pattern and toggle flags (i/g/m/s/y/u) as needed.
  2. Paste your test text; matches highlight in the preview and list below.
  3. Use `Treat pattern as literal` to escape regex characters.
  4. Enable `Safe mode` to limit input size and block suspicious patterns.
  5. Try Replace and Split testers to validate transformations.
  6. Use Test cases to validate expected matches or replacement output.
  7. Use Prev/Next or click a match to jump to highlights.
  8. Shareable URLs keep pattern, flags, and text in the query string.
  9. Shortcuts: Cmd/Ctrl+Enter to run, Cmd/Ctrl+L to focus pattern, Esc to clear selection.
  10. Copy or download matches as JSON for quick debugging.

FAQ & privacy

Does this run locally? Yes, everything happens in your browser; no data is sent to a server.

Why do I see no matches? Make sure your pattern is valid and flags are set correctly; use the sample button to verify the workflow.

What does “Pattern too expensive” mean? The matcher exceeded the time budget; simplify the regex or reduce input size.

Can I test large text? Yes, but inputs over ~50k chars will show a warning to avoid slow runs.