Regex Tester

Write a regex pattern, toggle flags, and see matches highlighted instantly in your test string. Each match shows its index position and capture groups. A collapsible cheat sheet keeps common syntax at your fingertips.

//g
Contact us at hello@example.com or support@toolzhq.com for help.
"hello@example.com"index 14
"support@toolzhq.com"index 35

How it works

The tester compiles your pattern into a JavaScript RegExp object with the selected flags. It then runs exec() in a loop to find every match in the test string. Matched portions are wrapped in highlighted spans while non-matched text is HTML-escaped to prevent XSS.

Results update in real time as you type. If your pattern contains a syntax error, a clear error message is shown instead of crashing. The flag checkboxes let you toggle global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u) modes.

The cheat sheet sidebar covers character classes, quantifiers, anchors, groups, and lookahead/lookbehind assertions — everything you need for day-to-day regex work without leaving the page.