How To Use Glob Pattern In Paths?

Undetstanding Glob Pattern and How To Use it In Paths?

Glob Pattern Overview

Glob patterns are widely used to match addresses in Unix-based systems. They utilize specific meta characters to define portions of an address:

  • ? : Represents any single character.
  • * : Matches any sequence of characters, including an empty string.
  • […] : Restricts the match to characters inside the brackets. You can specify a range of characters, such as a-z. To include the hyphen as a character, place it after a character. For example: [abc-].
  • […!] : Matches any character except those within the brackets.
  • **: matches with all sub-branche and any path after /.

Important Notes

  • Glob patterns in the new version of VergeCloud Security are not case-sensitive.
  • When considering the common format of <scheme>://<hostname>/<path> for URLs, the pattern matches only the <hostname>/<path> part, ignoring the /<scheme> portion.

Example: How Glob Patterns Match Paths

Glob PatternMatchesDoes Not Match
example.com/**Any path within example.com (not its subdomains)
*example.comAny subdomain of example.com
example.com/test*example.com/test
example.com/tests
example.com/TeSt
example.com/atest
example.com/test/icon.png
example.com/assets/**/*.jpgexample.com/assets/icon.jpg
example.com/assets/images/bg.jpg
example.com/assets/images/icons/ok.jpg
example.com/assets/icon.png
api.example.com/v?api.example.com/v1
api.example.com/v2
api.example.com/v
api.example.com/v1/items
api.example.com/v[0-9]/**api.example.com/v1
api.example.com/v1/items
api.example.com/v
api.example.com/va


    • Related Articles

    • SPF Records

      Sender Policy Framework (SPF) Sender Policy Framework (SPF) is a method used for email authentication that helps identify spoofed sender addresses upon email delivery. SPF enables the receiving email server to confirm that an email purportedly from a ...
    • Understanding HSTS (HTTP Strict Transport Security) and How to Enable It on VergeCloud

      What Is HSTS (HTTP Strict Transport Security)? HTTP Strict Transport Security (HSTS) is a security feature that forces web browsers to connect only via HTTPS for a specified duration. Once the browser learns about HSTS from a site, it upgrades all ...
    • What is SSL? Understanding Secure Sockets Layer for Website Security

      SSL (Secure Sockets Layer) is a standard security technology that establishes an encrypted link between a web server and a browser. This encryption ensures that any data transferred between the server and the user's browser remains private and ...
    • Understanding and Optimizing Time To First Byte (TTFB).

      Understanding Time To First Byte (TTFB) TTFB stands for "Time To First Byte," referring to the time it takes from the moment a browser sends an HTTP request to a server until the first byte of data is received. This duration includes DNS lookup and ...
    • Understanding IP Address Classes and CIDR Notation for IPv4 and IPv6

      IP Address Classes IP address classes are part of the classful network architecture that was used before the introduction of CIDR (Classless Inter-Domain Routing). They categorize IP addresses into different classes based on their range and intended ...