Regex Tester — Test Regular Expressions Online with Highlighting
Test regular expressions with live match highlighting, token-by-token explanation, cheat sheet, capture groups, unit tests, and replace preview.
Also searched as: regular expression tester · regex checker · regex playground · regex debugger · regexp tester
Explanation
[a-zA-Z0-9._%+-]Character class+One or more@Literal "@"[a-zA-Z0-9.-]Character class+One or more\.Escaped character[a-zA-Z]Character class{Literal "{"2Literal "2",Literal ","}Literal "}"
Quick reference
.Any character except newline\dDigit [0-9]\wWord character\sWhitespace[abc]Any of a, b, or c[^abc]Not a, b, or c*0 or more+1 or more?0 or 1{n}Exactly n times{n,m}Between n and m times^Start of string/line$End of string/line\bWord boundary(...)Capturing group(?:...)Non-capturing group(?=...)Positive lookahead(?!...)Negative lookaheadHow to Use
Step-by-step guide to get the most from this tool
- 1
Enter your regex pattern
Type your regular expression between the / delimiters and select flags (g, i, m, s, u).
- 2
Add test string
Paste or type text to test against. Matches are highlighted in color in real time.
- 3
Read the explanation
The right panel explains each token in your pattern and provides a quick reference cheat sheet.
- 4
Validate with unit tests
Add test cases in Advanced Options to verify your regex handles edge cases correctly.
Features
What makes this tool stand out
Token explanation
Understand every part of your regex pattern.
Cheat sheet
Built-in quick reference for classes, quantifiers, and groups.
Live highlighting
Color-coded match highlights in your test string.
Unit tests
Define test cases with expected match counts.
Capture groups
Table of all matches with index and group values.
Find & replace
Preview replacement output with group references.
Related Tools
More free utilities you might find useful
Frequently Asked Questions
Quick answers to common questions
What regex flavors are supported?+
This tool tests using JavaScript (ECMAScript) regex engine. Flavor selector labels PCRE and Python for reference — syntax differences like lookbehind are noted in the explanation panel.
What are regex flags?+
g finds all matches globally. i is case-insensitive. m enables multiline mode for ^ and $. s makes dot match newlines. u enables full Unicode matching.
How does the explanation panel work?+
It breaks your pattern into tokens and describes each part — character classes, quantifiers, groups, and anchors — similar to regex101.
What are capture groups?+
Parentheses () create numbered capture groups. The match information table shows each group value with a copy button for easy extraction.
How do unit tests work?+
Add test cases with input text and expected match count. The tool runs your regex against each input and shows PASS or FAIL for quick validation.
What is the difference between greedy and lazy matching?+
Greedy quantifiers (*, +) match as much as possible. Lazy versions (*?, +?) match as little as possible. Use lazy matching for precise extraction.
Can I test replace operations?+
Yes. Expand the replace section, enter a replacement string (use $1 for group 1), and see the transformed output with a copy button.
Is my regex data private?+
Yes. All matching runs entirely in your browser. No patterns or test strings are sent to any server.
