Skip to content

Free RegEx Tester

Test and debug regular expressions in real time. See live match highlighting, group captures and match count. All JS regex flags supported. Free, with no sign-up required — everything happens right in your browser, so nothing you enter is sent to a server.

💻 RegEx Tester

/ /

How the RegEx Tester Works

Enter a regular expression and optional flags, paste your test text, and the tool runs the pattern on the text as you type. All matches are highlighted in the text, the total number of matches is shown, and for each match you see its position and the contents of every capture group. Quick Patterns fill in common examples, such as an email address, a URL, a ten-digit phone number, a strong password, a hex colour and a date.

The tester uses your browser's JavaScript regular expression engine, so it behaves exactly like new RegExp in your own JavaScript or TypeScript code. Other languages such as Python, PHP, Java and PCRE are similar but not identical, with differences in features like lookbehind, named groups and flag handling. The g flag finds all matches, i ignores case, m lets ^ and $ match at each line, s lets the dot match line breaks, u enables full Unicode and y matches only at a fixed position. Quick Patterns are starting points, and no regex can fully validate real-world emails.

Practical Use Cases

  • Build and debug a pattern before putting it in code.
  • Check which parts of a text a pattern matches, and what each capture group holds.
  • Learn regex by experimenting with flags and examples.
  • Test input validation patterns for forms against valid and invalid examples.

Frequently Asked Questions

All JavaScript flags: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode) and y (sticky). You can enter several together, such as gi.
Put part of the pattern in parentheses. For (\d{4})-(\d{2})-(\d{2}) the groups hold the year, month and day, and each match lists them.
Usually for basic patterns, but not always. This tool uses the JavaScript engine, so features and syntax can differ from other languages.
Without the g flag, a regular expression stops at the first match. Add g to find all of them.
No. The pattern runs in your browser, and your test text is not sent anywhere.