Regular expressions are a tiny DSL for pattern matching. This guide covers the syntactic building blocks with examples.
Anchors
^ matches the start of a line; $ matches the end. \b matches a word boundary.
Character classes
[abc] matches any one of a, b, or c. [^abc] matches anything except. Use \d, \w, \s for digit, word, and whitespace.
Groups and quantifiers
(abc)+ matches one or more repetitions of abc. (?:abc) is a non-capturing group. Use alternation: foo|bar.