I am trying to use a regex to find text inside a string. For example, have this string:
one,two,three,four
If I want to see if it has one OR two, I can use "one|two". How do I create a regex for determining whether the string has one AND two?
I am trying to use a regex to find text inside a string. For example, have this string:
one,two,three,four
If I want to see if it has one OR two, I can use "one|two". How do I create a regex for determining whether the string has one AND two?
^(?=.*\bone\b)(?=.*\btwo\b)
= two lookahead assertions that match if both "one" and "two" are present in the string.