Sentence = I will buy a red car, a black racecar or a blue caravan
Pattern = car
Result: should match car
and caravan
(partial or whole word anywhere in the sentence). Should not match racecar
(not the beginning of a word)
Edit: This question is not a duplicate of Regex match entire words only because that question specifically asks NOT to match partial words. My requirement is to match partial OR whole words.