Free online tool

Regex Tester

Write a regular expression, see every match highlighted in your sample text, and inspect capture groups. Everything runs in your browser. Your files and text are not uploaded to our servers.

Use the tool

Loading the tool...

How to use it

  1. Type your pattern without the slashes, for example (\d{3})-(\d{4}).
  2. Tick the flags you need: g (all matches), i (ignore case), m (multiline), s (dot matches newline), u (Unicode).
  3. Paste test text. Matches are highlighted and listed with their positions and groups.
  4. Optionally type a replacement such as $2-$1 to preview the result.

Tips for best results

  • Start simple and add one part of the pattern at a time.
  • This tester uses JavaScript regular expressions, which differ slightly from other languages.
  • Very large inputs can be slow; at most 1000 matches are listed.

Frequently asked questions

Which regex flavor does it use?

JavaScript (ECMAScript). Most basic syntax is shared with other languages, but features such as lookbehind and named groups vary.

Why do I only see one match?

Turn on the g flag to find every match instead of the first one.

← Back to Developer Tools