tools / regex-tester

Regex Tester

Test a regular expression against sample text and see matches highlighted live. Everything runs in your browser.

Pattern
/ /
Test string
Matches (highlighted)

What is a regular expression?

A regular expression (regex) is a pattern that describes a set of strings — used to search, validate, or extract text. Instead of matching one exact string, a regex can match "three digits, a dash, four digits" or "anything that looks like an email address" in a single compact pattern.

Common flags

  • g — global, find all matches instead of stopping at the first
  • i — case-insensitive matching
  • m — multiline, ^/$ match line boundaries, not just string boundaries
  • s — dotAll, lets . match newlines too

Frequently asked questions

What regex engine does this use?

Your browser's native JavaScript RegExp engine — the same one your code runs against if you're testing patterns for a JS or Node.js project. Other languages (Python, PCRE, Java) have small syntax differences.

Why do I see capture groups listed below the matches?

Parentheses in a pattern like (\d+)-(\d+) create capture groups — parts of each match you can extract individually. This tool lists each match's captured groups so you can see exactly what a group like $1 would contain.

Is my text uploaded when I use this tool?

No. Matching happens instantly in your browser using JavaScript's built-in regex engine — nothing is sent to a server.