Skip to main content
Version: 2.7.x

glob_match

Public API

Macros and Functions

glob_match

Test if the passed path matches the glob expression.

* A single asterisk stands for zero or more arbitrary characters except for the the path separator / if match_path_separator is False

? The question mark stands for exactly one character except for the the path separator / if match_path_separator is False

** A double asterisk stands for an arbitrary sequence of 0 or more characters. It is only allowed when preceded by either the beginning of the string or a slash. Likewise it must be followed by a slash or the end of the pattern.

Example usage (generated):

load("@aspect_bazel_lib//lib:glob_match.bzl", "glob_match")

glob_match(
# the glob expression
expr = None,
# the path against which to match the glob expression
path = None,
)

expr

Required.

the glob expression

path

Required.

the path against which to match the glob expression

match_path_separator

Optional. Default: False

whether or not to match the path separator '/' when matching * and ? expressions

is_glob

Determine if the passed string is a globa expression

Example usage (generated):

load("@aspect_bazel_lib//lib:glob_match.bzl", "is_glob")

is_glob(
# the potential glob expression
expr = None,
)

expr

Required.

the potential glob expression