I am not sure if this can be solved with regex,
possibly the string needs to be chopped into words
and then stepped through ( but not sure how).
Anyway, this is what I have and it is very close to what
I want.:
Expand|Select|Wrap|Line Numbers
- preg_match_all("#((?:\b\w{1,20}\b\s+){2})#", $data, $matches)
[32] => technical support [33] => services attempt [34] => to help
[35] => the user [36] => solve specific [37] => problems with
As you can see, the data is just being divided into two word chunks.
And I am missing half of the possible phrases eg "support services"
is not reported.
This is not quite what I expected
What I wanted was a list of all the two word phrases,
so I should be getting:
[32] => technical support [33] => support services [34] => services attempt
[35] => attempt to [36] => to help [37] => help the [38] => the user
You see the overlap ?
This ensures that I do get all the phrases.
Any ideas on how would I need to change my
regex to achieve my desired output ?
If not possible, how else can I achieve it ?