Regular Expression - Global Search Between 2 Whole Words
问题 I'm attempting to search for content between 2 whole words using a regular expression. For example: all the girls went to the mall in town. In the above string I want to find the content between the word all and to : (?<=all).*?(?=to)/g However, it's finding two matches since the expression is not instructed to search between whole words only: " the girls went " //between all and to " in " //between m(all) and (to)wn I had thought to add spaces in the expression, like this: (?<= all ).*?(?=