Contents

wholeMatch(of:)

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

Declaration

func wholeMatch<R>(of regex: R) -> Regex<R.RegexOutput>.Match? where R : RegexComponent

Parameters

  • regex:

    The regular expression to match.

Return Value

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