<?php $qry = '[url="google.com"]google[/url] and [img]image here[/img]'; echo preg_replace('~\[(img|url)\b[^]]*](.*?)\[/\1]~is', 'REPLACED', $qry);
You have javascript disabled. You will not be able to edit any code.