Home / Data / Regex Tester

Regex Tester

Experiment with regular expressions against your own text and see every match highlighted instantly — with flag toggles, capture-group details and friendly errors when a pattern breaks.

—matches
—pattern status

JavaScript regex flavour. Nothing you type or test leaves this page.

Overview

Regex is a superpower with a readability problem. A pattern like \b\w+@\w+\.\w+\b does something genuinely useful — finds email-like strings — in a notation most people cannot read at a glance. The way past that is not memorisation but experimentation: change the pattern, watch the highlights move, and the notation starts making sense.

This page is a laboratory for exactly that. Type a pattern, paste some text, and matches light up where the engine finds them. Toggle the standard flags, inspect what each capture group grabbed, and when a pattern is malformed you get an explanation instead of silence.

What is a regular expression?

A pattern-matching language for text. Simple tokens match themselves; special tokens match classes (\d is any digit, \w any word character); quantifiers repeat (+ means one or more, * zero or more, ? optional); anchors pin things down (^ start, $ end); parentheses both group and capture. Combined, they describe whole families of strings in a few characters.

The classic uses are validation and extraction: does this look like a phone number, pull every date from this log, find all the TODO comments. The classic misuse is parsing nested formats like HTML with them — a trap so famous it has its own folklore. This tester keeps you honest by showing exactly what matched, which is where over-clever patterns get exposed.

Features

Benefits

Who can use it

Developers writing validators and parsers, data wranglers cleaning messy exports, QA engineers asserting on text output, students meeting regex in a course, and writers maintaining find-and-replace patterns across big documents. If your work involves the phrase “find all the…”, this page earns its bookmark.

How to use

  1. Type your pattern in the expression field — an email-finder is preloaded as a starting point.
  2. Toggle flags: g to find all matches, i to ignore case, m and s for multiline and dot-all.
  3. Paste your own text into the test area, or use the sample.
  4. Watch matches highlight; check the count and the capture-group breakdown.
  5. If the pattern errors, read the message, adjust, and watch the highlights come back.

Frequently asked questions

Why does my pattern match nothing at all?

Nine times out of ten it is case sensitivity (try the i flag), an anchor pinning the match where the text isn't (^ matches only at the start unless m is on), or a literal character that needs escaping — a dot in the pattern means “any character”, so matching a real dot needs \. Simplify until something highlights, then rebuild.

What is the difference between the flags?

g finds every match instead of stopping at the first; i makes letters match regardless of case; m lets ^ and $ work at each line boundary instead of the whole text; s lets the dot match newlines too. Most everyday testing needs only g and i.

How do capture groups work?

Parentheses group tokens together and simultaneously save what they matched, numbered $1, $2 and so on from the left. The inspector panel shows each group's capture for the first match — the quickest way to confirm a pattern extracts the pieces you intended, like area code vs number.

Can I use this to parse HTML?

Please don't. HTML nests arbitrarily, and regex cannot count nesting — patterns that work on today's markup break on tomorrow's. Use a real HTML parser in your language of choice; save regex for flat, regular text like logs, CSVs and identifiers.

Is my test text uploaded?

No. The pattern compiles and executes entirely inside your browser tab. Logs, emails and private data you paste for testing stay on your machine.

Conclusion

The way to get good at regex is reps with instant feedback — which is exactly what a live tester gives you. Keep patterns small, watch the highlights, trust the groups panel, and retire anything too clever to read next month.

Related tools

TextDiff CheckerSee every change between two texts, line by line. TextWord CounterLive words, characters, sentences and reading time. TextCase ConverterUPPER, lower, Title, camelCase and 9 more — one click.