I want to check if there are two or more values in a string, regardless of their positions within said string. For example, if I want a condition of "OR" in regex, I would do so:
/(a|b)/.test("a") // true
But what I need is an "AND"; something like this:
/(a&b)/.test("a") // false
/(a&b)/.test("b") // false
/(a&b)/.test("a b") // true
/(b&a)/.test("a b") // true
/(a&b&c)/.test("a b") // false
/(a&b&c)/.test("a c b") // true
Obviously this syntax is not correct...
These values a, b, c, etc. are pulled from an array. I've tried using a combination of eval() and indexOf(a) !== -1 && indexOf(b) !== -1 but that was too slow, which is why I'm turning to regexes.