wholeMatch(of:)

Returns a match if this string is matched by the given regex in its entirety.

iOS
16.0+
macOS
13.0+
tvOS
16.0+
watchOS
9.0+
func wholeMatch<R>(of regex: R) -> Regex<R.RegexOutput>.Match? where R : RegexComponent

Parameters

regex

The regular expression to match.

Returns

The match, if one is found. If there is no match, or a transformation in regex throws an error, this method returns nil.