Home > purgecss > matchesPattern
matchesPattern() function
Check if a value matches a pattern of the options: a regular expression, or a string written between slashes like "/^btn-/", is tested against the value, any other string matches the value exactly
Signature:
export declare function matchesPattern(pattern: string | RegExp, value: string): boolean;
Parameters
Parameter | Type | Description |
|---|---|---|
pattern | string | RegExp | string or regular expression |
value | string | value to match, e.g. a selector or a variable name |
Returns:
boolean
