How to use it 01 Type a pattern; the panel compiles it immediately and shows a parse error if it is invalid. 02 Toggle the flags you need: g global, i ignore case, m multiline ^/$, s dot-matches-newline, u Unicode, y sticky. 03 Paste test text and read the highlight, the match count and the match table. 04 Type a replacement using $1,
lt;name> or
amp; to preview the transformed text.
Worked readouts Pattern (?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2}) with flag g against this text:
Order dated 2026-07-30 by dev@example.com, phone 13800138000,
amount $1,299.00, host 192.168.31.7, colour #1e90ff.
Second order 2027-01-05 from ops@sample.cn — see https://example.com/a?b=1
finds 2 matches: 2026-07-30 at index 12 with groups 2026 / 07 / 30, and 2027-01-05 at index 128 with 2027 / 01 / 05. The replacement
lt;y>/
lt;m>/
lt;d> previews the dates as 2026/07/30 and 2027/01/05. Remove the g flag and the tester keeps the first match only (count 1) and the replacement touches just that occurrence — the flag is not decoration. An invalid pattern such as ( reports V8's message, "Invalid regular expression: /(/g: Unterminated group". The built-in email pattern finds dev@example.com and ops@sample.cn.
What the engine actually does The tester compiles a JavaScript RegExp — the ECMAScript flavour, not PCRE — and walks it over the text with exec, which is why group numbering starts at 1,
amp; means the whole match, and named groups use (?<name>…). Quantifiers are greedy by default (.* takes as much as possible) and a trailing ? makes them lazy (.*? takes as little as possible). Flags change matching semantics rather than the pattern: i folds case, m makes ^/$ per line, s lets . cross line breaks, u enables code-point mode, and y anchors each subsequent match to the previous end. When g is absent the tester adds it internally for iteration, then reports only the first match — so the count you see is what a non-global replace would affect.
Limits and honest assumptions
Bounded, not safe. The guard stops after 5,000 matches or 1,500 ms between matches, but a single exec that enters exponential backtracking cannot be interrupted — a hostile pattern can still freeze the tab. Simplify nested quantifiers instead of relying on the cap.
JavaScript flavour. Lookbehind is supported in modern engines, but atomic groups, possessive quantifiers (a++) and recursion are not; syntax that works in PCRE may fail here.
A pattern is not a parser. The email pattern matches the common local@domain.tld shape, not every address RFC 5322 allows. What it does not do. It does not validate JSON, decode Base64 or hash text; those live in JSON , Encoding and Hashing .
Catastrophic backtracking is the classic trap (a+)+$ against 30 as followed by b has an enormous number of ways to partition the prefix, and the engine tries them all before failing — a pattern that looks linear can take exponential time. Prefer explicit classes ([ab]+), anchor what you mean, and keep nested quantifiers out. The second trap is scope: ^ and $ mean start and end of the whole string unless m is on, and . excludes newlines unless s is on, so a pattern that works on one line quietly fails on three.
Where it is used Extracting fields from log lines Write a named-group pattern for the timestamp and request ID, check the match table against a few real lines, then use the same pattern in code with confidence about what each group holds.
Preparing a bulk rename or redaction Preview the replacement with $1/
lt;name> references and count the affected matches before running it anywhere destructive.
Privacy Patterns and test text are processed in your browser; nothing is uploaded, stored or logged.
References
ECMA International, ECMA-262 — ECMAScript Language Specification , ecma-international.org (访问日期:2026-10-07)— the normative RegExp grammar and semantics.
MDN Web Docs, Regular expressions , developer.mozilla.org (访问日期:2026-10-07)— flags, groups, quantifiers and replacement patterns.
IETF, RFC 5322: Internet Message Format , rfc-editor.org (访问日期:2026-10-07)— the real address grammar a pattern can only approximate.
Wikipedia, ReDoS , en.wikipedia.org (访问日期:2026-10-07)— why nested quantifiers explode.
Calculators in this hub
Hand-picked tools, one click away. The mini versions compute live and carry your values into the full calculator.
Sources & review
Reviewed by CalcX Editorial Team
Updated 2026-10-07