/.*/

Regex Tester

Test a regular expression against text live, see the matched groups, try replace mode, and get a step-by-step explanation of the pattern.

  • match
  • groups
  • replace
  • flags
  • explain
Enter a pattern
pattern
/ /
Test string
1
Result
—Matches
—Groups
—Text length
—Execution time
This tool runs entirely in your browser and uses JavaScript's standard regular expression engine (ECMAScript); for other languages (PCRE in PHP/Python, etc.) some syntax may differ slightly. The "Explain pattern" section is a rule-based analysis of your regex's structure, not an actual execution of it.
ABOUT

Live regex tester with match and group highlighting

Writing a regular expression without instant feedback is error-prone. This tool runs your pattern live against your text, highlights matches and capture groups, lets you toggle flags (g, i, m and more) and previews replacements. The engine is the JavaScript regex engine of your browser.

HOW TO

How to use it

  1. Write the pattern between the slashes and pick flags.
  2. Paste sample text and watch matches highlight.
  3. For replacements, write the replacement using $1, $2 and see the preview.
FAQ

Frequently asked questions

What is the difference between .* and .*??
.* is greedy and takes as much as it can; .*? is lazy and stops at the shortest match.
Is this the same as PCRE?
No, it is the JavaScript engine. Some PCRE features may behave differently.