RegEx Tester
Test and debug regular expressions with live match highlighting, group capture, and replace preview. Everything runs in your browser.
Test Regular Expressions Instantly
Regular expressions (regex) are powerful patterns for matching, searching, and replacing text. Zolkit's RegEx Tester evaluates your pattern against test input in real time using JavaScript's native RegExp engine, so what you test here behaves exactly as it would in your code.
Live Highlighting
Matches are highlighted in the test string as you type, with no delay.
Group Capture
View all captured groups from each match, numbered and colour-coded.
Flag Controls
Toggle global (g), case-insensitive (i), multiline (m), and dotAll (s) flags with one click.
Replace Preview
Enter a replacement string to preview the result of String.replace() or String.replaceAll() instantly.
100% Private
All matching runs locally in your browser. Nothing is sent to any server.
Free Forever
No account, no signup. Completely free to use.
How to Use the RegEx Tester
- 1
Enter your regular expression pattern in the Pattern field and select any desired flags (g, i, m, s).
- 2
Paste your test string into the Test String area. Matches will be highlighted immediately.
- 3
To preview a substitution, enter a replacement string in the Replace With field and view the Result.
Frequently Asked Questions
Which regex flavour does this tester use?
It uses JavaScript's native RegExp engine, which follows the ECMAScript specification. Patterns tested here behave identically in Node.js and all modern browsers.
What does the global (g) flag do?
Without the global flag, the regex matches only the first occurrence. With the global flag, it matches all occurrences in the string.
What is the dotAll (s) flag?
Normally, the dot (.) metacharacter does not match newline characters. The s flag (dotAll) makes it match any character including newlines.
How do I capture groups?
Wrap a sub-pattern in parentheses, for example (\d+). Captured groups are numbered from 1 and displayed in the match list below the highlighted output.
Can I use named capture groups?
Yes. Named groups use the syntax (?<name>pattern). They will be displayed by name in the group capture list.
Why does my pattern show an error?
JavaScript will throw a SyntaxError for invalid regex patterns, such as an unbalanced parenthesis or an invalid flag. The tester catches this error and displays a message.
What does the Replace field do?
It previews the result of applying your pattern as a replacement. With the global flag the behaviour matches String.replaceAll(), otherwise String.replace().