What this tool helps you do
Regular expressions are powerful, but small mistakes in the pattern or flags can change the result completely. This tester helps you try a regex against sample text, inspect the matches, and confirm that the pattern behaves the way you expect before using it in validation, parsing, filtering, or search workflows.
When to use this tool
You are writing a form validation rule — for email addresses, phone numbers, postal codes, or URLs — and want to confirm the pattern matches real inputs before adding it to your codebase.
You are processing text data in a script and need to verify that a search or replace pattern captures the right substrings before running it on the full dataset.
You are debugging an existing regex in an application or config file that is not behaving as expected and want to isolate the problem by testing it with specific inputs.
You are learning regular expression syntax and want a fast, readable way to experiment with patterns and see exactly which parts of the text each group and flag affects.
Common problems and fixes
The pattern matches nothing even though I can see the text I want.
Check that the pattern uses the correct case. Without the i flag, the regex is case-sensitive. Also verify that special characters in your pattern — such as . ( ) [ ] { } + * ? — are escaped with a backslash if you want to match them literally.
The tester returns an error saying the pattern is invalid.
An invalid pattern usually means an unescaped special character, an unclosed group (a ( without a matching )), or an unsupported flag. Read the error message — it identifies the position of the problem in the pattern.
I used the g flag but I only see one match.
The global flag (g) tells the engine to find all matches, not just the first one. Make sure g is entered in the Flags field, not included inside the pattern itself. The output will list all matches with their positions.
Related tools
Related Guides
Frequently asked questions
How do I use this regex tester?
Enter a regex pattern in the Pattern field, optionally add flags such as g or i in the Flags field, paste your test text, and click Test Regex to inspect the matches.
What flags does this regex tester support?
You can use any flag supported by the JavaScript RegExp engine: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), and d (indices).
Does the tester show which part of the text matched?
Yes. The output lists every match, its exact position (character index) in the text, and any captured groups from the pattern.
Does the regex tester show invalid patterns?
Yes. Invalid patterns or unsupported flags return a clear error message describing the problem instead of match output.
Can I test multi-line text?
Yes. Paste multi-line text into the test text area. Use the m flag if your pattern uses ^ or $ to match the start and end of individual lines rather than the whole string.
Is this regex tester free?
Yes. It is completely free to use and runs entirely in your browser — no account or sign-up required.