regex - Regular expression to match a line containing only the list of words -


looking regular expression match given list of words in strings

the regular expression pattern match strings containing boy or apple in below list of strings

[apple, boy, apple, boy]  [boy, boy, boy, boy]  [apple, boy, boy, boy]  

to match

[apple, boy, apple, boy] [apple, boy, boy, boy]  

try if works:

(?=.*apple)(?=.*boy).* 

Comments

Popular posts from this blog

c - zlib and gdi32 with OpenSSL? -

java - inputmismatch exception -

ios - Align baselines with characters in large line heights with Text Kit -