Match
A single matched span within a string.
Match values are returned by indexing a Captures.
Coercing one with str produces the matched text.
Fields
end @ IntThe byte offset of the end of the match within the haystack.
Example
Open in playgroundlet date = Regex r"(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})" let caps = date.match "prefix 2024-03-15 suffix" let year = caps["year"] echo $year # => 2024 echo $year.start # => 7 echo $year.end # => 11start @ IntThe byte offset of the start of the match within the haystack.