public static class WildcardGlobs.SpecialistGlobExpander
extends java.lang.Object
simple example: machine-{0-3}-{a,b} returns 8 values, machine-0-a machine-0-b machine-1-a ... machine-3-b; NB leading zeroes are meaningful, so {00-03} expands as 00, 01, 02, 03
quote INTERIOR_NOT_EXPANDABLE example: a{b,"c,d"} return ab ac,d
for more detail on special treatment of quote and parentheses see PhraseTreatment and WildcardGlobsTest
Constructor and Description |
---|
WildcardGlobs.SpecialistGlobExpander(boolean expandNumericRanges,
WildcardGlobs.PhraseTreatment quoteTreatment,
WildcardGlobs.PhraseTreatment parenthesesTreatment) |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
expand(java.lang.String glob)
expands glob, including custom syntax for numeric part
|
java.lang.String[] |
expandToArrayUnchecked(java.lang.String glob)
expands glob, including custom syntax for numeric part, but to an array, and re-throwing the checked exception as a runtime exception
|
boolean |
isGlobMatchedNumeric(java.lang.String globPattern,
java.lang.String targetText)
returns true iff the target matches the given pattern,
under simplified bash rules -- viz permitting * and ? and comma delimited patterns inside curly braces,
as well as things like {1,2,5-10} (and also {01,02,05-10} to keep leading 0)
|
public WildcardGlobs.SpecialistGlobExpander(boolean expandNumericRanges, WildcardGlobs.PhraseTreatment quoteTreatment, WildcardGlobs.PhraseTreatment parenthesesTreatment)
public java.util.List<java.lang.String> expand(java.lang.String glob) throws WildcardGlobs.InvalidPatternException
public boolean isGlobMatchedNumeric(java.lang.String globPattern, java.lang.String targetText) throws WildcardGlobs.InvalidPatternException
public java.lang.String[] expandToArrayUnchecked(java.lang.String glob)