Check that all lines match regex pattern in Java -
how check lines match regex pattern in java.
i mean able split lines myself in while loop. there library or standard api, implement functionality?
update ruby solution:
if text =~ /pattern/
here's utility method using guava returns true if every line in supplied text matches supplied pattern:
public static boolean matcheachline(string text, pattern pattern){ return fluentiterable.from(splitter.on('\n').split(text)) .filter(predicates.not(predicates.contains(pattern))) .isempty(); }
Comments
Post a Comment