public static Predicate < String > regex ( final String pathRegex ) { return new Predicate < String > ( ) { @ Override public boolean test ( String input ) { return input . matches ( pathRegex ) ; } } ; }
Predicate that evaluates the supplied regular expression