Regex Tester Online — Free Tool

Develop and test Regular Expressions (Regex) in real-time against custom sample texts with visual highlighting.

/
/g
Tip: Enable g to find all matches.
Matches
12 matches
Showing up to 12 matches
Highlighted preview
Paste your test string here. Try a pattern like: \b\w+\b
Match list
#1
05
Paste
#2
610
your
#3
1115
test
#4
1622
string
#5
2327
here
#6
2932
Try
#7
3334
a
#8
3542
pattern
#9
4347
like
#10
5051
b
#11
5253
w
#12
5556
b
Privacy note: All processing happens entirely in your browser. No data is sent to our servers.

About this tool

Regular expressions match patterns in text—emails, IDs, log lines. This tester runs your regex against sample strings with live highlights and capture groups.

Debug flags like global, case-insensitive, and multiline without redeploying code.

Common use cases

  • Tuning validation regex before shipping forms
  • Extracting fields from log samples
  • Learning capture groups and lookahead syntax
  • Comparing engine behavior on edge-case strings

How to use

  1. Enter a regex pattern and optional flags.
  2. Paste test strings in the input area.
  3. Inspect matches, groups, and replace preview if available.
  4. Iterate pattern until edge cases pass.

This page is available at /tools/regex-tester/.

Understanding the result

  • Group 0 is the full match; numbered groups are parenthesized subpatterns.
  • Global flag finds all matches; without it, only first match returns.
  • Catastrophic backtracking on nested quantifiers can freeze—simplify greedy patterns.
  • JavaScript regex differs slightly from PCRE—verify if you target other engines.

FAQ

What are capture groups?

Parentheses () capture matched substrings accessible as $1, $2 in replace or match[1], match[2].

Why does my regex not match?

Check anchors ^$, escaping special chars (. * + ?), and multiline mode for line-based text.

Greedy vs lazy?

Greedy * takes as much as possible; lazy *? stops at first valid match.

Is test data uploaded?

Local testers keep strings in your browser.