---
title: "wholeMatch(of:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/bidirectionalcollection/wholematch(of:)-1wbp6"
---

# wholeMatch(of:)

Matches a regex in its entirety, where the regex is created by the given closure.

## Declaration

```swift
func wholeMatch<Output>(@RegexComponentBuilder of content: () -> some RegexComponent) -> Regex<Output>.Match?
```

## Parameters

- `content`: A closure that returns a regex to match against.

## Return Value

Return Value The match if there is one, or nil if none.
