Guides/Regex Cheatsheet for Developers

Regex Cheatsheet for Developers

Quick reference for JavaScript regular expressions — then test live in Regex Lab.

Essentials

  • ^ / $ — start / end of string (or line with m)
  • . — any character except newline (unless s)
  • *, +, ?, {n,m} — quantifiers
  • (…) — capturing group; (?:…) — non-capturing
  • Flags: g i m s u y

Watch out for

Nested .* with alternation can cause catastrophic backtracking. Prefer tighter character classes and test edge cases in Regex Lab.

Try it live

Open the matching StackTools utility — runs in your browser.

Open Regex Lab