All processing happens locally in your browser. No data leaves your device.
Cheat Sheet (JS vs PCRE)
• Flags
JS: i, g, m, s, u, y (indices proposal: d)
PCRE: i, m, s, x, U, D, A, u
• Groups
( ... ) capture, (?: ... ) non-capture, (?<name> ... ) named
• Lookaround
(?=...), (?!...), (?<=...), (?<!...) — JS supports lookbehind in modern engines.
• Replacement tokens
JS: $1..$99, $&, $`, $', $$
PCRE: \1.., $1.., $&, $`, $', $$
• Differences (quick)
- PCRE supports atomic groups (?>...), possessive quantifiers a++ (JS no)
- PCRE x (free-spacing) is not in JS; emulate by stripping spaces/comments
- Anchors: ^, $, \A, \Z (PCRE) — JS lacks \A/\Z
- Named backref: \k<name> (PCRE) vs \k<name> in JS with u flag
• Safety tips
Prefer atomic/possessive constructs to avoid catastrophic backtracking.
Benchmark with a timeout and cap matches for large inputs.
Ready.