<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: 18.4.0 -",
    "macOS: 15.4.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtension/MatchPattern/matches(_:)-4d84f",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebExtensionMatchPattern(im)matchesPattern:"
  },
  "title" : "matches(_:)"
}
-->

# matches(_:)

Matches the receiver pattern against the specified pattern.

```
func matches(_ pattern: WKWebExtension.MatchPattern?) -> Bool
```

## Parameters

`pattern`

The pattern to match against the receiver pattern.

## Return Value

A Boolean value indicating if the receiver pattern matches the specified pattern.

## See Also

[`matches(_:options:)`](/documentation/WebKit/WKWebExtension/MatchPattern/matches(_:options:)-fnde)

Matches the receiver pattern against the specified pattern with options.



---

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)