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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -