---
title: WKWebExtension.MatchPattern
framework: webkit
role: symbol
role_heading: Class
path: webkit/wkwebextension/matchpattern
---

# WKWebExtension.MatchPattern

An object that represents a way to specify groups of URLs.

## Declaration

```swift
@MainActor class MatchPattern
```

## Overview

Overview All match patterns are specified as strings. Apart from the special <all_urls> pattern, match patterns consist of three parts: scheme, host, and path.

## Topics

### Errors

- [WKWebExtension.MatchPattern.Error](webkit/wkwebextension/matchpattern/error.md)
- [WKWebExtension.MatchPattern.Error.Code](webkit/wkwebextension/matchpattern/error/code.md)
- [errorDomain](webkit/wkwebextension/matchpattern/errordomain.md)

### Structures

- [WKWebExtension.MatchPattern.Options](webkit/wkwebextension/matchpattern/options.md)

### Initializers

- [init(coder:)](webkit/wkwebextension/matchpattern/init(coder:).md)
- [init(scheme:host:path:)](webkit/wkwebextension/matchpattern/init(scheme:host:path:).md)
- [init(string:)](webkit/wkwebextension/matchpattern/init(string:).md)

### Instance Properties

- [host](webkit/wkwebextension/matchpattern/host.md)
- [matchesAllHosts](webkit/wkwebextension/matchpattern/matchesallhosts.md)
- [matchesAllURLs](webkit/wkwebextension/matchpattern/matchesallurls.md)
- [path](webkit/wkwebextension/matchpattern/path.md)
- [scheme](webkit/wkwebextension/matchpattern/scheme.md)
- [string](webkit/wkwebextension/matchpattern/string.md)

### Instance Methods

- [matches(_:)](webkit/wkwebextension/matchpattern/matches(_:)-471rf.md)
- [matches(_:)](webkit/wkwebextension/matchpattern/matches(_:)-4d84f.md)
- [matches(_:options:)](webkit/wkwebextension/matchpattern/matches(_:options:)-5wo3g.md)
- [matches(_:options:)](webkit/wkwebextension/matchpattern/matches(_:options:)-fnde.md)

### Type Methods

- [allHostsAndSchemes()](webkit/wkwebextension/matchpattern/allhostsandschemes().md)
- [allURLs()](webkit/wkwebextension/matchpattern/allurls().md)
- [registerCustomURLScheme(_:)](webkit/wkwebextension/matchpattern/registercustomurlscheme(_:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)

## See Also

### Classes

- [WKWebExtension.Action](webkit/wkwebextension/action.md)
- [WKWebExtension.Command](webkit/wkwebextension/command.md)
- [WKWebExtension.DataRecord](webkit/wkwebextension/datarecord.md)
- [WKWebExtension.MessagePort](webkit/wkwebextension/messageport.md)
- [WKWebExtension.TabConfiguration](webkit/wkwebextension/tabconfiguration.md)
- [WKWebExtension.WindowConfiguration](webkit/wkwebextension/windowconfiguration.md)
- [WKWebExtensionController.Configuration](webkit/wkwebextensioncontroller/configuration-swift.class.md)
