Is there a standard (preferably Apache Commons or similarly non-viral) library for doing "glob" type matches in Java? When I had to do similar in Perl once, I just changed all the ".
" to "\.
", the "*
" to ".*
" and the "?
" to ".
" and that sort of thing, but I'm wondering if somebody has done the work for me.
Similar question: Create regex from glob expression
Globbing is also planned for implemented in Java 7.
See FileSystem.getPathMatcher(String)
and the "Finding Files" tutorial.