Is there a function to convert an Ant-style glob pattern into a regex?
问题 I know I can write one myself, but I was hoping I can just reuse an existing one. Ant-style globs are pretty much the same as normal file globs with the addition that '**' matches subdirectories. FWIW, my implementation is: public class AntGlobConverter { public static String convert(String globExpression) { StringBuilder result = new StringBuilder(); for (int i = 0; i != globExpression.length(); ++i) { final char c = globExpression.charAt(i); if (c == '?') { result.append('.'); } else if (c