<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DataDetection",
  "identifier" : "/documentation/DataDetection/DataDetector/Match/range",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "DataDetection"
    ],
    "preciseIdentifier" : "s:13DataDetection0A8DetectorO5MatchV5rangeSnySS5IndexVGSgvp"
  },
  "title" : "range"
}
-->

# range

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

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

## 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”.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)