---
title: anchored
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/nsdata/searchoptions/anchored
---

# anchored

Search is limited to start (or end, if searching backwards) of the data object.

## Declaration

```swift
static var anchored: NSData.SearchOptions { get }
```

## Discussion

Discussion This option performs searching only on bytes at the beginning of the range (or the end when using backwards). No match at the beginning or end means nothing is found, even if a matching sequence of bytes occurs elsewhere in the data object.

## See Also

### Constants

- [backwards](foundation/nsdata/searchoptions/backwards.md)
