How to use Regex Tester
- Enter your regular expression and flags, or choose a common pattern.
- Paste the text you want to search – matches are highlighted instantly.
- Check the groups table, and type a replacement to preview the replaced text.
About this tool
Regular expressions are powerful but easy to get wrong. This regex tester shows the effect of every change as you type: matches are highlighted in your test text, a table lists each match with its position and capture groups (including named groups), and the match count updates live.
Toggle regex flags such as g (all matches), i (ignore case), m (multiline), s (dot matches newlines) and u (Unicode), and see a clear message if the pattern has a syntax error. Type a replacement using $1, $2 or $& to preview a find-and-replace before you run it in your code. A list of ready-made patterns for emails, URLs, IP addresses, phone numbers, dates and hex colours gives you a starting point. The regex tester uses your browser's JavaScript engine, which matches the syntax used by most languages for everyday patterns.