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

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -