I am trying to learn regular expressions on my own, hence this silly activity.
I am trying to retrieve any word with “football” in it, but exclude “footballs” from that–so I can get anything else–footballer, footballers, football. Just not “footballs”.
I found that \bfootball(?!s)\b gets rid of both footballers and footballs. How do I only exclude “footballs”?
You must move word boundary inside the assertion:
That is more correct than remove the word boundary at all.
When you remove the boundary at all, you miss the words with
sand something after it:footballsafor example.