Type the pattern and switch on the flags you need (usually g and i).
Paste text; matches highlight live and the table lists each position and group.
Switch to Replace to rewrite text or Extract list to collect matches, then copy the code for your language.
Frequently asked questions
Why is only the first match found?
Without the g (global) flag JavaScript returns only the first match. Turn on "g Global" above to find them all.
How do I use groups in a replacement?
Use $1, $2 for numbered groups, $ followed by the group name in angle brackets for named groups; the cheat sheet lists the rest. To turn 2026-10-18 into 18/10/2026, use (\d{4})-(\d{2})-(\d{2}) and replace with $3/$2/$1.
Which regex flavour is this?
Your browser's JavaScript (ECMAScript 2024) syntax, with named groups, lookarounds and Unicode properties \p{…}. Most of it is the same in Python, PHP (PCRE), Java and C#; Go lacks lookarounds and back-references. The Code panel rewrites named groups and similar differences per language.
Is my text uploaded?
No. Matching runs in a separate thread in your browser and stops after 1 second to guard against catastrophic backtracking; nothing is sent to a server.
How do I write a regex for a phone number or an email address?
Common JavaScript patterns: a mainland China mobile number ^1[3-9]\d{9}$ (11 digits, second digit 3–9); a lenient email check ^[^\s@]+@[^\s@]+\.[^\s@]+$ (has @ and a dot, no spaces); Chinese characters [\u4e00-\u9fa5]; a 6-digit postcode ^\d{6}$. Keep form validation lenient — a regex cannot prove an address or number actually exists. This tool includes 18 common patterns; paste test text to see the matches and a step-by-step explanation.
regular expression tester practical guide and common questions
What does a regular expression tester do?
Regular expressions describe character patterns for matching, grouped extraction and replacement of identifiable text fragments.
Who is this for, and when is it useful?
Developers and content teams refining extraction or text-cleaning rules.
How do I use this regular expression tester?
Enter representative text, a pattern and flags, inspect matches and offsets, and include empty, boundary and nonmatching examples.
How should I interpret the results?
Test representative boundaries and replacement groups, and inspect flags such as g and i. JavaScript syntax differs from some other engines; simplify patterns stopped by the time limit.
Where is the work performed, and which services receive data?
JavaScript regular expressions run in an isolated browser Worker with a time limit. Input scripts are not executed and embedded URLs are not requested.