code: public static Predicate<String> regex(final String pathRegex) {
      return new Predicate<String>() {
        @Override
        public boolean test(String input) {
          return input.matches(pathRegex);
        }
      };
    }
docs: Predicate that evaluates the supplied regular expression
  
  @param pathRegex - regex
  @return predicate that matches a particular regex