For a linguistics project I am trying to match all occurrences of one or two consonants between vowels in some text. I am trying to write a very simple matcher in PHP (preg_match_all
), but once the match is consumed, it cannot match again.
The following is very simple and should do the trick, but only matches the first occurrence:
[aeiou](qu|[bcdfghjklmnprstvwxyz]{1,2})[aeiou]
In: officiosior
: offi
and osi
are returned, but not ici
because the trailing i
is the first part of the match in the second match.
As far as I can tell, it's impossible to do, but is there a decent way to work around the issue?