---
title: range
framework: swift
role: symbol
role_heading: Instance Property
path: swift/anyregexoutput/element/range
---

# range

The range over which a value was captured, if there was a capture.

## Declaration

```swift
var range: Range<String.Index>? { get }
```

## Discussion

Discussion If nothing was captured, range is nil.
