- Core ConceptsThe Pattern type: starting a chain with Pattern.With, method chaining, immutability, automatic escaping, options, ToString/ToRegex and value equality.
- Basic PatternsAnchors, single-character matchers, literal text and raw regex: the building blocks every pattern starts from.
- Character ClassesShorthand classes, sets, ranges, character lists, negated sets and Unicode categories: every way to match one character from a group.
- QuantifiersRepeat an element a fixed, bounded or open number of times, and choose greedy, lazy or possessive matching.
- Groups and BackreferencesCapturing, named, non-capturing and atomic groups, reading group values, backreferences and conditional patterns.
- Assertions (Lookaround)Lookahead and lookbehind: match text only when the right context follows or precedes it, without making that context part of the match.
- Composing PatternsReuse patterns as building blocks: join them with Then and +, offer alternatives with OneOf and |, scope options inline, wrap existing regexes and compare patterns by value.
- Semantic Rules and ValidationAttach checks a regex cannot express, such as checksums and real dates, explain why a value failed, and validate models with [MatchesPattern].
Building Patterns
Every building block of the fluent API, from anchors and character classes to groups, assertions and rules.