Looking for a regular expression to match only the given list of words in a strings
The regular expression pattern to match strings containing only boy or apple in the 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]