Regex Tester
Test regular expressions with live match highlighting, capture groups and common flags. Runs in your browser, nothing uploaded.
Test regular expressions online with live match highlighting, capture groups and flags (g, i, m, s). Paste your pattern and text, and matches light up as you type — the fastest way to debug a regex without running code.
How to test a regular expression
Enter a JavaScript regular expression in Pattern and paste sample text into Test text. Matches are highlighted as you type, while the results list shows match positions and capture groups.
Enable g for all matches, i for case-insensitive matching, m for multiline input, s for dot-all matching, or u for Unicode behavior. The tester uses the ECMAScript regex engine found in modern browsers.
Full guide: How to test a regular expression without getting burned
Engine: ECMAScript (JavaScript) regular expressions — the same engine browsers and Node.js use.
Highlighted text
Example
Pattern \b\d{4}-\d{2}-\d{2}\b with flag g, on this text:
Deployed 2026-10-14, rolled back 2026-10-15.
Ticket 12026-10-140 is not a date.
gives 2 matches: 2026-10-14 and 2026-10-15. Without the \b word boundaries you get a third, false match inside 12026-10-140. Walk-through in the regex guide.
How to use the Regex Tester & Matcher
- Type your regex pattern and choose flags.
- Paste or type the test text.
- Matches, groups and positions appear live as you type.
Frequently asked questions
How do I test a regex online?
Enter your pattern and test string above; matches are highlighted live with zero setup.
What regex flavor does it use?
The JavaScript regex engine (ECMAScript), the same engine used by browsers and Node.js.
What do the flags g, i, m, s mean?
g = global, i = case-insensitive, m = multiline, s = dot matches newlines.
Can I see capture groups?
Yes — each match expands to show its numbered capture groups.
Fun facts about Regex Tester
- Regular expressions originated in the 1950s from mathematician Stephen Kleene's work on formal language theory.
- The regex engine in JavaScript (ECMAScript) uses a backtracking algorithm, which is powerful but can be slow on certain patterns — this is called 'catastrophic backtracking.'
- The famous Perl regex that validates email addresses against RFC 822 (Mail::RFC822::Address) is over 6,000 characters long.
- Perl's regex syntax was so influential that the PCRE library (Perl Compatible Regular Expressions) became a de facto standard, used by PHP, Apache and many other tools.
- The word 'regex' is short for 'regular expression' — a term from automata theory describing patterns that finite-state automata can recognize.