I'm trying to sort of do a two-in-one regex match for GA keywords
Want to say the following, that either the optional prefix or one (or both) of the optional suffixes must be present to match – along with the 'required middle' string, 'people' in this case
So only these combinations would match:
people
happy people
happy people smile
happy people smile often
people smile
people smile often
This would not match:
happy people smile often in Connecticut
Or anything else for that matter
I've never used lookaheads; I'm guessing this might be the solution(?)
Open to other solutions if there are any
Again, I'm using Google Analytics if someone needs to know what regex flavour
While the above list is useful, I also need to know how to do it so that "people" alone would not match for some queries, but only lines 2-6 in the example.
So I guess I really need two expressions