Skip to content

Regex Tester

Test regular expressions with live match highlighting.

  • Free
  • No sign-up
  • No watermark
  • Works in your browser

Also called: regular expression tester, regex checker.

About Regex Tester

Test JavaScript regular expressions against your own text and see every match highlighted, with capture groups listed. It is meant for learning, debugging and checking a pattern before you use it in code. Patterns run in a sandboxed background worker with a time limit, so a badly written pattern cannot freeze the page.

How to use Regex Tester

  1. Enter your pattern between the slashes and choose flags such as g, i or m.
  2. Paste the text you want to test.
  3. Check the highlighted matches and the match list.
  4. Adjust the pattern until it matches exactly what you want.

Tips and good to know

  • This tool uses the JavaScript regular-expression engine; other languages (Python, PCRE, .NET) have small differences.
  • Nested repetition such as (a+)+ can take exponential time on some inputs; the tester stops after two seconds and tells you.
  • Use the i flag for case-insensitive matches and the g flag to find every match rather than just the first.

Regex habits that save time

Anchor patterns with ^ and $ when the whole text must match, or a phone check will accept letters around the number. Quantifiers like .* are greedy and grab as much as possible; add ? (.*?) to make them stop at the first match. Escape special characters such as . ? + ( ) when you mean them literally. Patterns with nested repeats, such as (a+)+, can take extremely long on some inputs, so test with long, non-matching text too.

Building a pattern step by step

Regular expressions are easiest to write in small steps. Start with a literal piece of the text you want to match, check it matches, then replace parts with character classes such as \d (a digit), \w (a letter, digit or underscore) and \s (whitespace), and add quantifiers such as + (one or more) or {2,4} (two to four). Anchors ^ and $ tie the match to the start and end of the text or line.

Greedy quantifiers grab as much as they can, so <.+> on “<b>bold</b>” matches the whole string. Adding ? (as in <.+?>) makes it lazy, matching as little as possible.

Frequently asked questions

Is my text sent anywhere?

No. The pattern and text are processed locally in a web worker inside your browser.

Is Regex Tester free?

Yes. Regex Tester is free: no sign-up, no paid plan, no trial and no limit on how often you use it. It runs in your browser, and ToolzAura is paid for by ads, so every tool stays free.

Are my files uploaded?

No. This tool runs in your browser, so your input stays on your device.

Maintained by Malik Shaheer · Last reviewed · How we test tools · Report a problem

Related tools

SVG Editor

Draw and edit SVG graphics.

Developer Tools

Tailwind CSS Playground

Try Tailwind classes with a live preview.

Developer Tools

Barcode Generator

Make Code 128, EAN and other barcodes.

Developer Tools

QR Code Generator

Create QR codes for links, text and Wi-Fi.

Developer Tools

QR Code Scanner

Scan a QR code from an image or your camera.

Developer Tools

QR Code with Logo

Create a QR code with your logo in the middle.

Developer Tools