Developer Tool

Regex Tester

Write a pattern, paste your test string, and see matches highlighted in real time. Toggle flags, inspect capture groups, and copy the final regex. No data leaves your browser.

Regular Expression

Valid
8 matches
//g

Flags

Test String

122 chars ยท 3 lines

Match Preview

8matches
The quick brown fox jumps over the lazy dog.
Pack my box with five dozen liquor jugs.
How vexingly quick daft zebras jump!

Match Details8 matches

Match 1overindex 26..30
Match 2lazyindex 35..39
Match 3Packindex 45..49
Match 4withindex 57..61
Match 5fiveindex 62..66
Match 6jugsindex 80..84
Match 7daftindex 105..109
Match 8jumpindex 117..121

Example Patterns

Quick Reference

Anchors

^Start of string / line
$End of string / line
\bWord boundary
\BNon-word boundary
\AStart of string
\ZEnd of string

Character Classes

.Any char except newline
\dDigit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word char
\sWhitespace
\SNon-whitespace
[abc]Any of a, b, or c
[^abc]Not a, b, or c
[a-z]Character range

Quantifiers

*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (greedy)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m
*?0 or more (lazy)
+?1 or more (lazy)
??0 or 1 (lazy)

Groups & Lookaround

(abc)Capture group
(?:abc)Non-capture group
(?<n>abc)Named group n
|Alternation (or)
(?=abc)Lookahead
(?!abc)Negative lookahead
(?<=abc)Lookbehind
(?<!abc)Neg. lookbehind

Frequently asked questions

Is my regex pattern or test data sent to a server?
No. All regex matching runs entirely in your browser using JavaScript's native RegExp engine. Your pattern and test strings never leave your device and are not stored anywhere.
Why isn't my regex matching what I expect?
Common issues: forgetting the g flag when expecting multiple matches, case-sensitivity without the i flag, anchoring too tightly with ^ or $ so only full lines match, or special characters like . + * ? that are metacharacters, not literals, and need escaping with a backslash.
What regex flags does this tester support?
All standard JavaScript flags: g (global, find all matches), i (case-insensitive), m (multiline, ^ and $ match line boundaries), s (dotAll, . matches newlines), u (Unicode mode), and y (sticky, matches from lastIndex only). Toggle any combination using the flag buttons.
What is a capture group and how do I use it?
A capture group is part of a regex pattern enclosed in parentheses, e.g., (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string. The tester shows each group's matched value in the results panel. Named groups use the (?<name>pattern) syntax.
Can I test regex against multiline text?
Yes. Paste multiline text into the test string area. Use the m flag to make ^ and $ match the start and end of each line rather than the full string. Use the s flag if you need . to also match newline characters.