Regex Tester

Free online regex tester. Test regular expressions against your text with live match highlighting, capture groups and flags — instantly and privately in your browser.

✓ Free ⚡ Instant 🔒 100% private
0 matches
/ /g
Test string
Highlighted matches
Enter a pattern and some text to see matches.

🔒 Your pattern and text are processed entirely in your browser — nothing is uploaded.

Advertisement

Free Regex Tester

This free online regex tester lets you build and check regular expressions in real time. Type a pattern, pick your flags, paste any test string, and every match is highlighted instantly — with a live match count, the captured groups, and the index of each result. It’s free, needs no sign-up, and runs entirely in your browser, so your patterns and text never leave your device.

How to use the regex tester

  1. Enter your pattern in the expression box (for example \d+). Don’t add the surrounding slashes — they’re shown for you.
  2. Tick the flags you need: g for all matches, i to ignore case, and so on.
  3. Paste your test string into the test box on the left.
  4. Watch the matches highlight on the right, and read each match’s capture groups in the details list below.
  5. Click Copy matches to grab every matched substring at once.

Regex quick reference

A regular expression describes a search pattern. These are the tokens you’ll reach for most often:

  • \d — any digit (0–9); \w — a word character (letters, digits, underscore); \s — any whitespace.
  • . — any character (except newline, unless the s flag is on).
  • + — one or more; * — zero or more; ? — zero or one (optional).
  • ^ — start of the string (or line with m); $ — end of the string or line.
  • [abc] — a character set matching any one listed character; [a-z] matches a range.
  • (...) — a capture group, so you can extract part of the match separately.

The flags change how the whole pattern behaves: g (global) finds every match instead of just the first, i makes matching case-insensitive, m (multiline) makes ^ and $ match at line breaks, s (dotall) lets . match newlines, u enables full Unicode handling, and y (sticky) anchors each search to the previous match’s end.

Frequently asked questions

Is this regex tester free and private?
Yes. It is completely free with no sign-up, and all matching happens in your browser with JavaScript. Your pattern and test text are never uploaded to a server.
Which regex syntax does this tool use?
It uses the JavaScript (ECMAScript) regular expression engine built into your browser, the same one used in web apps and Node.js. Most common tokens work across languages, but a few advanced features can differ from Python, PCRE or Java.
What do the g and i flags do?
The g (global) flag finds every match in the text instead of stopping at the first one, and the i flag makes the search case-insensitive, so the pattern abc would also match ABC or Abc.
How do I see capture groups?
Wrap part of your pattern in parentheses to create a capture group. For each match the tool lists every group and its captured value below the highlighted text, so you can confirm exactly what each group caught.
Why does my pattern show an error?
If the pattern is not valid, for example an unclosed bracket or group, the tool shows a red message explaining the problem instead of crashing. Fix the highlighted issue and matching resumes automatically as you type.
Advertisement