See above :)Quote:
You could do it by putting preg_match() in a loop and incrementing the offset each time, for the length of the string. Not very efficient, I guess. You'd have to keep track of the match positions, as well, or you'd count some of the matches more than once.
It's not that inefficient considering that string operations aren't too bad and regex is bad, but the difference between an internally recursive function and looping it is minimal.
It works. Now I understand "end" in the correct way... I had missed that completely before reading through the documentation trying to figure it out. Thanks.

