I was wondering if there was an easy way to do this. I need to search a image tags in a bb post. The tags can be [ img] or < img> (since I dont want vB to try and do something with it I put a space).

Right now I have a loop to find the [ img] start and ending tags. It works great using strpos. But I really dont want to have to do this long loop again to find the start and end < img> tags. So I was wondering if anyone had any idea on how I can do this in one loop. Like with something simular to preg_match or something.