Regex Tester

Test and debug regular expressions

FreeNo sign-upDeveloper Tools →

Regex Tester runs a regular expression against sample text and highlights every match as you type. It uses your browser's JavaScript regex engine, so results match what the same pattern does in JavaScript and TypeScript code.

Flags g, i, m and s can be switched on and off, capture groups are listed for each match, and a replace panel shows the outcome of substituting with references such as $1 and $2. Ready-made patterns for email, URL, IPv4, dates and hex colours are included as starting points.

Advertisement

How to use Regex Tester

1

Enter a pattern

Type the expression and choose flags.

2

Add test text

Matches are highlighted immediately.

3

Try a replacement

Open the replace panel and use $1, $2 for groups.

Use Cases

  • Debugging a validation pattern before shipping it
  • Working out a find-and-replace for a text editor
  • Extracting fields from log lines

Frequently Asked Questions

Related Guides from Our Blog