Online Regex Tester
Test a regex against text and see match positions and groups.
Developer Tools Runs in your browser
What is a regex tester?
Type an expression, add flags, and watch each match land with its zero-based index and numbered capture groups. A pattern like (\w+)@(\w+) run against sales@acme reports the full hit at @0 with $1 sales and $2 acme, so you can see exactly which group grabbed what before the pattern goes anywhere near your codebase.
How to use the Regex Tester
- 1 Write the expression and set flags like i or m.
- 2 Add a test string in the second field.
- 3 Read each hit with its @index position and $1, $2 group captures.
- 4 Adjust the pattern until the matches land where you expect.
What you can use it for
- Debugging a regex before pasting it into code.
- Checking that a pattern captures the right groups.
- Learning how flags change matching behaviour.
- Trying sample input against a validation rule.
Frequently asked questions
What is the @index number next to each match?
The zero-based position of the match’s first character in the test string. If a match reports @14, the pattern hit fourteen characters in.
How do capture groups appear in the results?
Each parenthesised group is listed after the match as $1, $2 and onward with the text it captured, so nested groups can be verified one at a time.
Will my pattern behave the same in Python or Go?
Mostly. Matching here uses the JavaScript engine, and while core syntax is shared, features like lookbehind and named groups vary between languages, so retest edge cases.
Related tools
More Developer Tools
More tools like this:
All Developer Tools