DEVELOPER · LIVE HIGHLIGHTING · JS ENGINE

Regular Expression Tester

Type a pattern and see matches highlighted live in your test text, with capture groups listed for every match. Uses the JavaScript regex engine — what works here works in Node and the browser.

Quick reference: \d digit · \w word char · \s whitespace · . any char · + one or more · * zero or more · ? optional · ^ start · $ end · [abc] character set · (x) capture group · a{2,4} repetition range.

Infographic: regex anatomy — the Indian mobile pattern [6-9]\d{9} decoded piece by piece with each token labeled
Every regex is just small pieces: a set, a shorthand, a count, a flag.

Common patterns to steal

GoalPattern
Email (practical)[\w.+-]+@[\w-]+\.[\w.]{2,}
Indian mobile number(\+91[\s-]?)?[6-9]\d{9}
URLhttps?:\/\/[\w.-]+(\/\S*)?
Date YYYY-MM-DD\d{4}-\d{2}-\d{2}
Trailing whitespace[ \t]+$ (with m flag)
Duplicate words\b(\w+)\s+\1\b

Frequently asked questions

Which regex engine does this tester use?

JavaScript's built-in engine (ECMAScript) — the same one in Node.js and every browser. Most patterns transfer to Python, Java, and PCRE unchanged, but some advanced features differ: JavaScript lacks recursion and possessive quantifiers, for example.

What do the g, i, m, and s flags do?

g finds all matches instead of stopping at the first; i ignores letter case; m makes ^ and $ match at every line start and end instead of just the text's start and end; s makes the dot . also match newline characters.

Why does my pattern match too much?

Usually greedy quantifiers: .* grabs as much as possible. Make it lazy with .*? or, better, replace the dot with a specific negated set like [^"]* to stop at the next quote. Test here with realistic text — greedy surprises show up instantly in the highlighting.

Is my test text sent anywhere?

No — matching happens entirely in your browser as you type. Paste logs or real samples freely; nothing is transmitted.

Related free tools

TEXT

Text Case Converter

Normalize text case before pattern matching.

GENERATOR

Fake Data Generator

Generate realistic test strings to match against.