I'm trying to write a regex expression (under R) that matches all the words containing 3 letters in this text:
tex= "As you are now so once were we"
My first attempt is to select words containing 3 letters surrounded by spaces:
matches=str_match_all(tex," [a-z]{3} ")
It's supposed to match " you ", " are " and " now ". But, since some of these spaces are shared between the matched strings, I only get " you " and " now ".
Is there a way to fix this issue ?
Thanks in advance