I have an string of |DOGS|MAN|CAT| and I need to check that DOG and CAT exist in the string.
The input string is always split between pipes.
I have this at present:
((^|, )(?=.*\|DOG|\b.$)(?=.*\|CAT\b).*$)
This almost works, if my input string was |DOG|MAN|CAT| it is fine but as I have specified DOGS not DOG it should not match

if (/^(?=.*\|CAT\|)(?=.*\|DOG\|)/.test("|" + s + "|") { return true; }