Regex Tester

Test JavaScript regular expressions with live highlighting, capture groups and replacement preview, safely isolated in a background worker.

  • Free
  • No signup
  • Private
Flags

Highlighted matches



  

  

Match details

Matching runs in your browser inside a background worker with a 1.5 second limit, so an expression that takes too long (catastrophic backtracking) is stopped instead of freezing the page. Nothing you type is sent to our server.

Overview

Test JavaScript regular expressions with live highlighting, capture groups and replacement preview, safely isolated in a background worker.

Features

  • •Live matching with highlighting
  • •Numbered and named capture groups
  • •Replacement preview using $1, $& and $<name>
  • •Flags g, i, m, s, u and y
  • •Common examples to start from
  • •Runs in a background worker that is stopped if a pattern takes too long

Benefits

  • Immediate feedback while you type
  • Clear explanation of every match and group
  • Protection from freezing on slow patterns
  • Private: nothing leaves your browser

Use Cases

  • Validating emails, URLs or dates in a form
  • Extracting values from logs
  • Planning a search-and-replace
  • Learning how flags and groups work

Users Also Use

How to Use

  1. Type your regular expression and choose the flags you need.
  2. Paste the text to test; matches are highlighted as you type.
  3. Read the match details and capture groups, try a replacement, then copy the expression or the results.

FAQ

Which regex flavor does it use?
JavaScript (ECMAScript) regular expressions, using your browser's own engine. Other languages such as PCRE or Python can behave differently.
What happens with a catastrophic pattern?
The matching runs in a Web Worker with a 1.5 second limit. If it takes longer, the worker is terminated and you get a message instead of a frozen page.
Is my text uploaded?
No. Everything runs in your browser; the expression and the test text are not sent to our server.
Does it run my code?
No. Only regular expression matching and string replacement are performed. No user-supplied script is executed.
Why does the g flag matter?
With g the tool lists every match. Without it, only the first match is returned and replacement changes only the first occurrence.

About Regex Tester

Debug and learn regular expressions with instant feedback. See each match, capture group and named group, preview replacements and avoid expressions that can freeze a page.

Keep exploring