I am trying to find two words in a sentence , either one word or both may exist in the sentence .Words are bait
and bated
I am trying to use the concept of capturing group and was able to get the two words using the below regex ba(?:it)?(?:ted)?
.The problem with this is that it returns
ba
for words like balance or bala etc...
Can it possible to get a regex of the similar structure but without matching ba
?