public class GlobUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
toRegexPattern(String glob)
Transforms the given
glob to a regular expression suitable for passing to
Pattern.compile(String). |
public static String toRegexPattern(String glob)
glob to a regular expression suitable for passing to
Pattern.compile(String).
| Construct | Description |
|---|---|
* |
Matches a (possibly empty) sequence of characters that does not contain slash (/) |
** |
Matches a (possibly empty) sequence of characters that may contain slash (/) |
? |
Matches one character, but not slash |
[abc] |
Matches one character given in the bracket, but not slash |
[a-z] |
Matches one character from the range given in the bracket, but not slash |
[!abc] |
Matches one character not named in the bracket; does not match slash |
[a-z] |
Matches one character outside the range given in the bracket; does not match slash |
{one,two,three} |
Matches any of the alternating tokens separated by comma; the tokens may contain wildcards, nested alternations and ranges |
\ |
The escape character |
glob - the glob expression to transformPatternIllegalStateException - in case the glob is syntactically invalidCopyright © 2021 JBoss by Red Hat. All rights reserved.