Contents

prefixMatch(of:)

Returns a match if this string is matched by the given regex at its start.

Declaration

func prefixMatch<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.