Free Online Regex Tester
Type a JavaScript regular expression and test it against your text. Matches are highlighted in real time with capture groups and an optional replace preview.
Match Highlighting
0 matchesMatches & Capture Groups
Replace Test
How to Use the Regex Tester
1. Enter Your Regex
Type your regular expression in the pattern box. Use JavaScript regex syntax, such as \b\w+@\w+\.\w+\b for email addresses.
2. Choose Flags
Toggle flags to change matching behavior: g (all matches), i (ignore case), m (multiline), s (dotAll), and u (unicode).
3. Paste Test Text
Add the text you want to search. Matches are highlighted instantly and listed with their capture groups.
4. Test Replacements
Enter a replacement pattern (e.g. $1) to preview what a substitution would produce.
What is a Regular Expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. Regex is used to match, find, and manipulate text in virtually every programming language, including JavaScript, Python, and Java.
Common patterns include \d+ for numbers, \w+ for words, ^ and $ for anchors, and parentheses ( ... ) to capture groups. Our tester evaluates your pattern with the native JavaScript RegExp engine so the results match what you get in the browser.