🔍 Regex Tester

Test regular expressions with real-time highlighting and capture groups.

Last updated: November 8, 2026 · By the BoltQuickTools team

/ /
Quick Reference
.Any character (except newline) \dDigit [0-9] \wWord char [A-Za-z0-9_] \sWhitespace ^Start of string/line $End of string/line *0 or more +1 or more ?0 or 1 {n,m}Between n and m times [abc]Character class (abc)Capture group (?:abc)Non-capturing group a|bAlternation (a or b) (?=abc)Positive lookahead (?!abc)Negative lookahead

See what a pattern really matches

A regular expression that looks right can still miss the last line, swallow too much, or capture the wrong group. Trying it against real sample text before it goes into validation, log parsing or a find and replace shows those problems straight away.

Testing a pattern

  1. Type the pattern into Regular Expression, without the surrounding slashes. Backslashes are entered once, not doubled as they would be in a string.
  2. Set flags in the small box after the second slash, or use the buttons: g, m, i, s and u. g and m are on by default.
  3. Put your sample in Test String. Results update on every keystroke.
  4. Read Matches Highlighted and the Match Details cards. Quick Reference opens a short syntax list.

A worked example

With the pattern (\w+)@(\w+)\.com, flags gm and this test string:

[email protected]
[email protected], [email protected]

the status line says "2 matches found" and the details read:

Match 1 at index 0: "[email protected]"
Groups: $1="ana", $2="example"
Match 2 at index 30: "[email protected]"
Groups: $1="cy", $2="shop"

The .org address is skipped because the dot and com are required. Remove the g flag and only the first match is reported.

Behaviour to watch for

Questions about results

Why does my pattern match nothing across lines?

. stops at a line break unless s is on. Separately, ^ and $ apply to each line only with m.

What does an empty highlight mean?

Zero-length matches, such as \b, count as matches and add to the total but have no width to highlight. \b against hi yo reports 4 matches.

How do I match punctuation in a sample literally?

Run it through the regex escape tool first, then paste the result here. The regex guide explains groups and lookaheads in more depth, and the cheatsheet lists the syntax.