---
title: "contains(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/bidirectionalcollection/contains(_:)-1l08t"
---

# contains(_:)

Returns a Boolean value indicating whether the collection contains the given regex.

## Declaration

```swift
func contains(_ regex: some RegexComponent) -> Bool
```

## Parameters

- `regex`: A regex to search for within this collection.

## Return Value

Return Value true if the regex was found in the collection, otherwise false.
