---
title: range
framework: datadetection
role: symbol
role_heading: Instance Property
path: datadetection/datadetector/match/range
---

# range

The range of characters in the original text corresponding to the match.

## Declaration

```swift
let range: Range<String.Index>?
```

## Discussion

Discussion Use this range to add visual highlighting or interactive UI controls to the displayed text. To extract semantic information from a match, examine its details properties. note: Don’t use this range to infer semantic information from the matched string. Some values might be more complex to interpret than a direct usage of the matched string and may need interpretation, for example, a phone number with a spelled-out extension, such as “(415) 555-1212 ext. 9876”.

## See Also

### Match details

- [details](datadetection/datadetector/match/details.md)
- [preferredHighlightStyle](datadetection/datadetector/match/preferredhighlightstyle.md)
