RegexBuilder provides a result-builder DSL for composing Swift regular expressions declaratively, assembling patterns from character classes, alternations, and captures instead of from a literal string. You build a pattern by combining components such as CharacterClass and Anchor, expressing repetition with One, OneOrMore, ZeroOrMore, Optionally, and Repeat, and choosing between alternatives with ChoiceOf. Capture and TryCapture extract matched substrings, while Reference, Lookahead, NegativeLookahead, and Local give you backreferences and zero-width matching for more precise patterns.
Matching Elements 2
The building blocks that match characters and positions within a pattern.
- StCharacterClassiOS 16.0+A class of characters that match in a regex.
- StAnchoriOS 16.0+A regex component that matches a specific condition at a particular position
Quantifiers 5
Components that express how many times a subpattern should repeat.
- StOneiOS 16.0+A regex component that matches exactly one occurrence of its underlying
- StOneOrMoreiOS 16.0+A regex component that matches one or more occurrences of its underlying
- StZeroOrMoreiOS 16.0+A regex component that matches zero or more occurrences of its underlying
- StOptionallyiOS 16.0+A regex component that matches zero or one occurrences of its underlying
- StRepeatiOS 16.0+A regex component that matches a selectable number of occurrences of its
Alternation 1
A component for matching one of several alternative subpatterns.
- StChoiceOfiOS 16.0+A regex component that chooses exactly one of its constituent regex
Captures and References 3
Components that extract matched substrings and refer to them elsewhere in a pattern.
- StCaptureiOS 16.0+A regex component that saves the matched substring, or a transformed result,
- StTryCaptureiOS 16.0+A regex component that attempts to transform a matched substring, saving
- StReferenceiOS 16.0+A reference to a captured portion of a regular expression.
Lookahead and Scoping 3
Zero-width assertions and scoped matching that constrain a pattern without consuming input.
- StLookaheadiOS 16.0+A regex component that allows a match to continue only if its contents
- StNegativeLookaheadiOS 16.0+A regex component that allows a match to continue only if its contents
- StLocaliOS 16.0+A regex component that represents an atomic group.
Structures 1
- StAlternationBuilderiOS 16.0+A custom parameter attribute that constructs regular expression alternations
Enumerations 1
- EnRegexComponentBuilderiOS 16.0+A custom parameter attribute that constructs regular expressions from