Regex Tester
Test regular expressions against sample text.
Your files stay on your device
This tool processes everything locally in your browser. Nothing is uploaded to a server.
๐ About Regex Tester
The Regex Tester lets you try a regular expression against sample text and see every match immediately. Enter a pattern, optional flags and some test text, and the tool lists how many matches it found and displays each one as a chip. If the pattern has a syntax error, the error message from the regex engine is shown instead.
Regular expressions describe text patterns compactly: \d matches a digit, \w a word character, + means one or more, and parentheses create groups. They are used for validating input such as emails or phone numbers, extracting values from logs, and search-and-replace in editors. Because a small mistake can make a pattern match too much or too little, testing against real examples before putting it in code saves a lot of debugging.
The tester uses JavaScriptโs RegExp engine, so syntax follows JavaScript rules. The g flag is always applied so that all matches are found; you can add i for case-insensitive or m for multiline mode. Testing happens live in your browser.
๐ How to use
- 1
Write the pattern
Enter your regular expression in the Pattern field without surrounding slashes.
- 2
Add flags and text
Type optional flags such as i or m, then paste the text you want to test against.
- 3
Review the matches
Check the match count and the list of matched strings, which update as you type.
โ FAQ
Which regex flavor does this tool use?
It uses the JavaScript RegExp engine built into your browser. Most common syntax is shared with other languages, but some features such as possessive quantifiers differ.
Do I need to add the g flag?
No. The tool always adds g so every match in the text is listed. Add other flags like i, m, s or u as needed.
Should I escape backslashes in the pattern?
No. Type the pattern as you would inside /.../, so a digit is \d. Double escaping is only needed when writing the pattern as a string in source code.
Does it show capture groups separately?
No. Each chip shows the full matched text. To inspect groups, you can temporarily narrow the pattern to the part you want to check.