| java.lang.Object jregex.Pattern jregex.util.io.PathPattern
PathPattern | public class PathPattern extends Pattern (Code) | | A special-purpose subclass of the Pattern class.
Has two different applications:
to search files by their paths using special patterns;
to match path strings
Syntax:
? - any character but path separator
* - any string no including path separators
** - any path
Usage:
PathPattern pp=new PathPattern("jregex/**"); //all files and directories
//under the jregex directory
Enumeration files=pp.enumerateFiles();
Matcher m=pp.matcher();
while(files.hasMoreElements()){
File f=(File)files.nextElement();
m.setTarget(f.getPath());
if(!m.matches()) System.out.println("Error in jregex.io.PathPattern");
}
See Also: jregex.WildcardPattern |
PathPattern | public PathPattern(String ptn, boolean icase)(Code) | | |
|
|