I would definitely resort to using pcre instead of posix, for the reason laserlight mentioned. So looking at that pattern, if I am deciphering it correctly (been ages since I used ereg, as that is dead to me), it could look like this (using preg instead of ereg):
'#((?:\s*<img src=\'/img/b\.png\' class=\'[redYlowCard]+\' alt=\'\' />\s*)*)#'
Granted, looking at the original pattern, it does leave me wondering about the class attribute.. why a character class with redYlowCard characters? Seems odd.. are you looking for very specific attribute values? As it stands, i will find any combination of those letters one or more consecutive times.
Overall, I question the construction of your pattern in general. What are you trying to do exactly?