ranges(of:)
Finds and returns the ranges of the all occurrences of a given sequence within the collection.
Declaration
func ranges(of regex: some RegexComponent) -> [Range<Self.Index>]Parameters
- regex:
The regex to search for.
Return Value
A collection or ranges in the receiver of all occurrences of regex. Returns an empty collection if regex is not found.