webutilkit

Regex Tester

Test a JavaScript regular expression against text and see every match highlighted, in your browser.

How it works

The pattern and flags are compiled into a real JavaScript RegExp and run against your test text. Every match is highlighted in place, using the same matching engine your code will actually run against.

Common flags

g finds every match instead of stopping at the first (applied automatically here), i ignores case, m makes ^ and $ match the start and end of each line rather than the whole string, and s lets . match newlines too.

Debugging a pattern that matches too much or too little

Watch which parts of the text get highlighted as you adjust the pattern. A pattern that is too greedy usually shows up as matches spanning further than expected; one that is too narrow shows up as expected text left unhighlighted.

Frequently asked questions

Which regex dialect does this use?

JavaScript’s own RegExp engine — the same one running in whatever browser or Node.js code you are testing for, though other languages’ regex dialects have their own small differences.

Does it find all matches or just the first?

All of them. The global flag is applied automatically even if you do not add it yourself, since seeing every match is the point of a tester.