URL Match Pattern

Last Updated May 18, 2026

Brief Overview

Match patterns let you specify groups of URLs that a browser extension should apply to. Each match pattern matches a specific set of URLs.

Match Pattern Structure

All match patterns are specified as strings and consist of three parts: scheme, host, and path. The scheme and host are separated by ://.

<scheme>://<host><path>

Scheme

The scheme can be either http or https.

Host

The host component takes one of three forms:

  • * — Matches any host
  • *. followed by part of a hostname — Matches the given host and any of its subdomains
  • A complete hostname without wildcards — Matches only the given host
Note

The host must not include a port number. The wildcard may only appear at the start.

Path

The path must begin with /. After that, it can contain any combination of the * wildcard and any characters allowed in URL paths or query strings. Unlike the host, the path can contain the * wildcard in the middle or at the end, and wildcards may appear more than once.

The path matches against the URL path plus the URL query string, including the ? between them if a query string is present.

For example, to match URLs on any domain where the path ends with foo.bar, use an array of match patterns like ['*://*/*foo.bar', '*://*/*foo.bar?*']. The ?* anchors the ending * to the query string rather than the URL path.

Note

  • URL fragment identifiers and the # that precedes them are not considered part of the path.
  • The path pattern string shouldn't include a port number. Adding a port — for example, http://localhost:1234/* — causes the match pattern to be ignored. However, http://localhost:1234 matches with http://localhost/*.

Examples

Pattern Example matches Example non-matches

https://*/path

Match HTTPS URLs on any host, whose path is "path".

https://mozilla.org/path

https://a.mozilla.org/path

https://something.com/path

http://mozilla.org/path
(unmatched scheme)https://mozilla.org/path/
(unmatched path)https://mozilla.org/a
(unmatched path)https://mozilla.org/
(unmatched path)https://mozilla.org/path?foo=1
(unmatched path due to URL query string)

https://*/path/

Match HTTPS URLs on any host, whose path is "path/" and which has no URL query string.

https://mozilla.org/path/

https://a.mozilla.org/path/

https://something.com/path/

http://mozilla.org/path/
(unmatched scheme)https://mozilla.org/path
(unmatched path)https://mozilla.org/a
(unmatched path)https://mozilla.org/
(unmatched path)https://mozilla.org/path/?foo=1
(unmatched path due to URL query string)

https://mozilla.org/*

Match HTTPS URLs only at "mozilla.org", with any URL path and URL query string.

https://mozilla.org/

https://mozilla.org/path

https://mozilla.org/another

https://mozilla.org/path/to/doc

https://mozilla.org/path/to/doc?foo=1

http://mozilla.org/path
(unmatched scheme)https://mozilla.com/path
(unmatched host)

https://mozilla.org/a/b/c/

Match only this URL, or this URL with any URL fragment.

https://mozilla.org/a/b/c/

https://mozilla.org/a/b/c/#section1

Anything else.

https://mozilla.org/*/b/*/

Match HTTPS URLs hosted on "mozilla.org", whose path contains a component "b" somewhere in the middle. Will match URLs with query strings, if the string ends in a /.

https://mozilla.org/a/b/c/

https://mozilla.org/d/b/f/

https://mozilla.org/a/b/c/d/

https://mozilla.org/a/b/c/d/#section1

https://mozilla.org/a/b/c/d/?foo=/

https://mozilla.org/a?foo=21314&bar=/b/&extra=c/

https://mozilla.org/b/*/
(unmatched path)https://mozilla.org/a/b/
(unmatched path)https://mozilla.org/a/b/c/d/?foo=bar
(unmatched path due to URL query string)

Invalid Match Patterns

  • resource://path/ — Unsupported scheme.
  • https://mozilla.org — No path.
  • https://mozilla.*.org/* in host must be at the start.
  • https://*zilla.org/* in host must be the only character or be followed by ..
  • http*://mozilla.org/* in scheme must be the only character.
  • https://mozilla.org:80/ — Host must not include a port number.
  • https://* — Empty path: this should be https://*/*.

URL Match Pattern vs Regex

WalkMe lets you configure extensions using either URL match pattern or Regex. Here's how they compare.

URL match pattern

URL match pattern is built specifically for browser extensions. It uses a simple syntax with wildcard characters to define which URLs an extension should apply to — for example, content scripts or background scripts.

Regex

Regex (regular expression) is a powerful, general-purpose tool for pattern matching within strings. It lets you search, extract, or replace text using a combination of characters and metacharacters. It's widely used in text processing, data validation, and programming.

Comparison

Purpose URL match pattern is created and optimized for web browsers to define which URLs a browser extension should apply to.
Regex is a powerful tool for pattern matching in strings, using a combination of characters and metacharacters.

Usage URL match pattern is used by browser extensions to specify which web pages they should operate on.
Regex can be used across a wide range of applications, like text processing, data validation, and search and replace operations.

Syntax URL match pattern uses wildcard characters like * and ? to specify URL patterns. Regex uses metacharacters like . (any character), * (zero or more occurrences), and + (one or more occurrences).

Example URL match pattern: https://example.com/* matches any URL starting with https://example.com/. Regex: ^(http|https)://example\.com(?:/[^/?#]+)*$ matches URLs belonging to example.com.

Pros and cons

URL match pattern — pros

  • Simple and intuitive for URL matching
  • More readable than complex regex
  • The recommended standard for browser extensions

URL match pattern — cons

  • Limited to URL matching only
  • Not suitable for general-purpose pattern matching
  • Tailored specifically for browser extensions

Regex — pros

  • Versatile across a wide range of pattern matching tasks
  • Rich syntax for highly precise matching
  • Can handle complex patterns beyond URL structures

Regex — cons

  • Complex expressions can be challenging and error-prone
  • Extremely complex patterns can cause performance issues
  • Hard to read and maintain

WalkMe Recommendation

WalkMe recommends using URL match pattern for extension configuration whenever possible. Regex should be a last resort for edge cases. URL match pattern guarantees seamless extension functionality, minimizes behind-the-scenes rules validation, and provides a better experience overall.

URL match pattern is the default for any new system configuration in the admin extension settings.

Was this article helpful?

Thanks for your feedback!

Be part of something bigger.

Engage with peers, ask questions, share ideas

Ask the Community
×