🔍 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
- Type the pattern into Regular Expression, without the surrounding slashes. Backslashes are entered once, not doubled as they would be in a string.
- Set flags in the small box after the second slash, or use the buttons: g, m, i, s and u.
gandmare on by default. - Put your sample in Test String. Results update on every keystroke.
- 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
- This is JavaScript's regex engine, the one in your browser. PCRE or Python syntax may not carry over:
(?i)abcgives "Invalid regular expression: /(?i)abc/gm: Invalid group" in Chromium browsers. Results that pass here can still differ on a server in another language. - A slow pattern can freeze the tab. Matching runs on the page's main thread with no timeout, so nested quantifiers such as
(a+)+bon long input may lock it until you close it. - Counting stops at 1001. With the
gflag, the search ends after 1001 matches and the status reports that number even if more exist. Only the first 50 get detail cards, followed by "...and 951 more matches". - Named groups are shown by number.
(?<year>\d{4})appears as$1. - Unmatched optional groups look empty.
$2=""can mean the group captured nothing or did not take part. - The flag buttons overwrite the flag box. Typing
gmyand then pressing a button drops they, because only the five button flags are rebuilt. - There is no replace mode. The tool finds matches and stops there.
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.