Regex Tester

Type a pattern, paste your text, and see every match — with groups and flags explained.

Runs in your browser Developer No signup
Ready · local only
Flags

g — find every match, not just the first.

Matched in this tab — no upload, no account.
ResultWaiting for a pattern
Type a pattern and paste text.

The pattern is JavaScript — no slashes needed. The sample shows named groups in action.

Actions for this tool. The full controls are above.

01 Capability

What it does

Small details that make the job quicker.

  • Matches highlight live in your text as you type, with zero-width matches marked instead of silently skipped.
  • Every match lists its numbered and named capture groups, so you can see exactly what a group caught.
  • Flags g, i, m, s and u are plain toggles, each labelled with what it changes.
  • Copy the whole match set as clean JSON, ready for a script, a test fixture or a spreadsheet.
  • Human errors explain an unterminated group, a stray quantifier or an unfinished character class.
  • Runs on the browser's own RegExp engine with no upload, no account and no external request.

02 Questions

Questions

Short answers, no small print.

Is this JavaScript regular expression syntax?

Yes. The pattern is compiled with the browser's own RegExp engine, so lookahead, lookbehind, named groups and Unicode property escapes work where the browser supports them. Write the pattern without the surrounding slashes; use the flag buttons instead.

Why does my pattern match more text than I expected?

Quantifiers such as * and + are greedy by default: they take as much as they can and then give back only what the rest of the pattern needs. Add ? after a quantifier to make it lazy, anchor the pattern with ^ and $, or use a narrower character class. The highlighted matches show exactly what was taken.

What do the flags do?

g finds every match instead of stopping at the first. i ignores case. m makes ^ and $ match the start and end of each line. s lets . match a newline. u turns on Unicode mode, which changes how escapes such as \p{L} are read. Turn g off when you only want the first match.

Why is a group shown as undefined or missing?

The group is optional and did not take part in that match — for example, the (s)? in /cat(s)?/ when the text says cat. That is normal. The tool leaves the group out of the JSON rather than pretending it matched an empty string.

Can I test a pattern against a very large document?

Up to 100,000 characters. Beyond that the tool asks you to shorten the text rather than freezing the tab. It also stops collecting after 2,000 matches and says so; copying includes the matches it found.

Is my pattern or text sent anywhere?

No. Compiling, matching and highlighting all happen in this browser tab. There is no upload, account, logging or external request, and both fields disappear when you close the page.

Private by default Matching runs in your browser with JavaScript's own RegExp engine. The pattern and text you type are never uploaded, logged or stored by Astra, and they disappear when you close this tab. Read the privacy note.