Use this regex cheat sheet as a compact reference, then test every expression in the Regex workspace with realistic input.
Anchors and character classes
^text$matches the complete string.\d,\w, and\smatch a digit, word character, and whitespace.[A-Z]matches one uppercase Latin letter;[^0-9]matches a non-digit..matches one character except a newline unless thesflag is used.
Groups and repetition
(abc)captures a group;(?:abc)groups without capturing.(?<name>abc)creates a named group in JavaScript.+,*, and?mean one-or-more, zero-or-more, and optional.{2,4}matches between two and four repetitions.
JavaScript flags
Use g for all matches, i for case-insensitive matching, m for line anchors, s for dot-all, and u for Unicode-aware patterns. Regex uses JavaScript syntax, so check your destination environment before copying a pattern.