Wildcard
Matching strings to wildcards pattern is useful and often needed. Using regular expression may help, but is not a top performance solution. Wildcard
class matches strings to wildcard patterns using *
and ?
characters, and that does very fast and good!
Matching strings
Here are some examples:
Matching file paths
Wildcard
class supports path matching wildcards. It matches path against pattern using *
, ?
and **
wildcards. Both path and the pattern are tokenized on path separators (\
and /
). **
represents deep tree wildcard, as in Ant.
Wildcards in Jodd
Wildcard matching is used in many places in Jodd. As the general rule-of-the-thumb, everywhere where file paths are involved in scanning and matching, the matchPath()
method is used, otherwise, the classic path()
.
Last updated