The Essential Regex Elements
Regular expressions are built from a small set of core elements. Character classes like \d (digits) and \w (word characters) match categories of characters. Anchors like ^ and $ match positions, not characters. Quantifiers like + and * control repetition. Combined, these build patterns from simple to complex.
JavaScript-Specific Features
JavaScript's regex engine includes modern features: named groups (?<name>...) for readable captures, lookbehind (?<=...) for matching based on preceding context, the s flag making . match newlines, and Unicode property escapes \p{Script=Greek} with the u flag.
Interactive Learning
This isn't just a static reference — every example in the cheat sheet is clickable. Click a row to load its pattern and sample text into the tester above. Modify the pattern or text to experiment. This makes it easy to learn regex by doing, not just reading.