@Test public void regexString() { String antStyleWildcard = "**/*Test.???"; String regex = AntStyleWildcardUtil.regexString(antStyleWildcard); assertEquals(".+?/[^/]*?Test..{1}.{1}.{1}", regex); }
public static String regexString(String antStyleWildcard) { String regex = antStyleWildcard; regex = regex.replaceAll("\\?", ".{1}"); regex = regex.replaceAll("\\*\\*", ".+?"); return regex.replaceAll("\\*", "[^/]*?"); }
AntStyleWildcardUtil { public static String regexString(String antStyleWildcard) { String regex = antStyleWildcard; regex = regex.replaceAll("\\?", ".{1}"); regex = regex.replaceAll("\\*\\*", ".+?"); return regex.replaceAll("\\*", "[^/]*?"); } }
AntStyleWildcardUtil { public static String regexString(String antStyleWildcard) { String regex = antStyleWildcard; regex = regex.replaceAll("\\?", ".{1}"); regex = regex.replaceAll("\\*\\*", ".+?"); return regex.replaceAll("\\*", "[^/]*?"); } private  AntStyleWildcardUtil(); }
AntStyleWildcardUtil { public static String regexString(String antStyleWildcard) { String regex = antStyleWildcard; regex = regex.replaceAll("\\?", ".{1}"); regex = regex.replaceAll("\\*\\*", ".+?"); return regex.replaceAll("\\*", "[^/]*?"); } private  AntStyleWildcardUtil(); static String regexString(String antStyleWildcard); static Pattern regex(String anyStyleWildcard); }
AntStyleWildcardUtil { public static String regexString(String antStyleWildcard) { String regex = antStyleWildcard; regex = regex.replaceAll("\\?", ".{1}"); regex = regex.replaceAll("\\*\\*", ".+?"); return regex.replaceAll("\\*", "[^/]*?"); } private  AntStyleWildcardUtil(); static String regexString(String antStyleWildcard); static Pattern regex(String anyStyleWildcard);  }