Java String pattern -
i have file text , need check if pattern match. file in lines in example:
dog blabla cat blablabla dog somethingelse cat dog badsad
what correct way check if file text match pattern after cat can dog or sometext?
you use regex. i'm not sure question pattern trying match, clarification helpful, in meantime, in regexs
^(dog\n.*\ncat\n?)+$
this match series of lines, starting dog, line break, text, line break, cat, repeating @ least once.
Comments
Post a Comment