Essentials
^/$— start / end of string (or line withm).— any character except newline (unlesss)*,+,?,{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.