Almost no way of telling, without seeing some code, but...
You're using preg_match() in a loop? preg_match() - do something - preg_match() ...? if yes,then the problem is that preg_match() is finding the first match every time.
The simplest solution is to use [man]preg_match_all/man instead, (as described on that page) and loop through the resulting array.