Online Regex Tester & Debugger
Regular expressions are powerful but easy to get wrong. This tool lets you write a pattern, paste sample text, and instantly see which parts match — with color-coded highlights so you can tell matches apart at a glance. No page reloads, no login, nothing sent to a server.
Live match highlighting
As you type your pattern, every match in the test string is highlighted using a transparent overlay. Up to three alternating colors (purple, pink, teal) cycle across consecutive matches so overlapping or adjacent results stay distinguishable. Capture groups appear as extra columns in the Matches table below the editor.
Capture groups & named groups
Wrap any part of your pattern in parentheses to create a capture group. The Matches table gains a new column for each group — $1, $2, and so on. Use named groups like (?<year>\d{4}) and the column header shows the name instead of a number.
Replace & substitution preview
Enter a replacement string to preview the result of a String.replace() call in real time. Use $& to insert the whole match, $1…$9 for capture groups, or $$ for a literal dollar sign. Copy the result with one click.
Regex flags
Toggle any of the five standard JavaScript flags directly in the toolbar: g (global — find all occurrences), i (case-insensitive), m (multiline — ^ and $ match per line), s (dotAll — . matches newlines), u (full Unicode support).
Frequently asked questions
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used to match, find, or replace text in strings and is supported natively in JavaScript, Python, Java, PHP, and most other languages.
How do I test a regex for email validation?
Paste a pattern like [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}, enable the i flag for case-insensitivity, and enter sample email addresses in the test string. Matches indicate valid-looking emails.
What regex flags does this tool support?
All five standard JavaScript flags: g (global), i (case-insensitive), m (multiline), s (dotAll), and u (unicode).
How do I use capture groups?
Wrap part of your pattern in parentheses: (\w+)\s(\w+). Each group gets its own column ($1, $2…) in the Matches table. Named groups ((?<first>\w+)) show their name as the header.
Is my data sent to a server?
No. Everything runs client-side in JavaScript. Your patterns and test strings are never transmitted to any server.