Adam Galmor

0

votes
0

answer
12

views

Regex for Matching All Strings That Contain Two Different Words from a List

I have need for a regular expression (in Java) that matches a string if and only if it contains two different words from a given list. For example, if the list of words is {blue,yellow,pink}, then the strings "blue and pink" and "yellow is the new blue" will match, but the strings "I like blue" will...
Adam Galmor