Regex Cheat Sheet
Every regex token, explained, with copyable examples.
Test regular expressions live, with highlighted matches and groups.
JavaScript (ECMAScript), because matching runs in your browser. It is close to PCRE for everyday patterns, but there are differences: no possessive quantifiers, no atomic groups, no recursion, and lookbehind requires a reasonably modern browser.
A pattern with nested quantifiers can backtrack catastrophically, taking exponential time on input that looks harmless. Since matching runs on the main thread, that would freeze the tab. Patterns are capped at 1 KB and the test string at 100 KB, which keeps worst-case matching survivable.
g finds all matches rather than stopping at the first, i ignores case, m makes ^ and $ match at line boundaries, s lets . match newlines, and u enables full Unicode handling. The tester enables g by default so you see every match.
Every regex token, explained, with copyable examples.
Turn any title into a clean, URL-safe slug.
Sort lines alphabetically, numerically, by length or at random.
Your input is saved in this browser so a refresh does not lose it. Tools handling credentials are never saved.