API > wxt/utils/match-patterns > MatchPattern
Class: MatchPattern 
Class for parsing and performing operations on match patterns.
Contents 
Example 
const pattern = new MatchPattern("*://google.com/*");
pattern.includes("https://google.com");            // true
pattern.includes("http://youtube.com/watch?v=123") // falseConstructors 
new MatchPattern(matchPattern) 
new MatchPattern(
matchPattern):MatchPattern
Parse a match pattern string. If it is invalid, the constructor will throw an InvalidMatchPattern error.
Parameters 
▪ matchPattern: string
The match pattern to parse.
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:22
Properties 
convertPatternToRegex 
privateconvertPatternToRegex:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:33
escapeForRegex 
privateescapeForRegex:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:34
hostnameMatch 
privatehostnameMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:13
isAllUrls 
privateisAllUrls?:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:15
isFileMatch 
privateisFileMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:30
isFtpMatch 
privateisFtpMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:31
isHostPathMatch 
privateisHostPathMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:29
isHttpMatch 
privateisHttpMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:27
isHttpsMatch 
privateisHttpsMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:28
isUrnMatch 
privateisUrnMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:32
pathnameMatch 
privatepathnameMatch:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:14
protocolMatches 
privateprotocolMatches:any
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:12
PROTOCOLS 
staticPROTOCOLS:string[]
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:11
Methods 
includes() 
includes(
url):boolean
Check if a URL is included in a pattern.
Parameters 
▪ url: string | URL | Location
Source 
node_modules/.pnpm/@webext-core+match-patterns@1.0.3/node_modules/@webext-core/match-patterns/lib/index.d.ts:26
Generated using typedoc-plugin-markdown and TypeDoc