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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -