Protocol_StringProcessing5.9.0
RegexComponent
A type that represents a regular expression.
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
protocol RegexComponent<RegexOutput>
You can use types that conform to RegexComponent
as parameters to string searching operations and inside RegexBuilder
closures.
Requirements
associatedtype RegexOutput
The output type for this regular expression.
var regex: Regex<Self.RegexOutput>
The regular expression represented by this component.
Citizens in _StringProcessing
Subtypes
Available in RegexBuilder
where Self == CharacterClass
Members
init(CharacterClass, CharacterClass...
) Creates a character class that combines the given classes in a union.
static var any: CharacterClass
A character class that matches any element.
static var anyGraphemeCluster: CharacterClass
A character class that matches any single
Character
, or extended grapheme cluster, regardless of the current semantic level.static var anyNonNewline: CharacterClass
A character class that matches any element that isn’t a newline.
static var digit: CharacterClass
A character class that matches any digit.
static var hexDigit: CharacterClass
A character class that matches any hexadecimal digit.
static var horizontalWhitespace: CharacterClass
A character class that matches any element that is classified as horizontal whitespace.
static var newlineSequence: CharacterClass
A character class that matches any newline sequence.
static var verticalWhitespace: CharacterClass
A character class that matches any element that is classified as vertical whitespace.
static var whitespace: CharacterClass
A character class that matches any element that is classified as whitespace.
static var word: CharacterClass
A character class that matches any element that is a “word character”.
static func anyOf<S>(S
) -> CharacterClass Returns a character class that matches any character in the given string or sequence.
static func anyOf<S>(S
) -> CharacterClass Returns a character class that matches any Unicode scalar in the given sequence.