I have a few sentences that contain a set of words. The regex pattern must match two words in order to be true. But I have a combination of 3 words to be matched that are case insensitive.
The following expression does a great job... but not quite. I wish to shorten the expression by getting rid of the last group and instead having the first group validate the last group. (I have the last group to match any you or your after the hum.)
Here are the sentences it needs to match within.Code:(\b[yY]ou(r)?\b.*){1,2}(\bhum(ming)?\b(\byour?\b.*)?)
If the pattern above matches.. I need it to then grab the areas where it didn't match and ONLY those areas.Code:Your continue to hum your song. You continue to fumble slightly as you hum a confident lullaby. You finish humming a confident lullaby. You continue to hum a confident lullaby with only the slightest hint of dofficulty.