< EDIT >
I Wanted to give a big thank you to all of you who have provided an answer, You have all given me great options. I will play with each and see which one suits my exact needs prior to selecting an answer. I do appreciate all of your responses though, everyone has a different approach to things. =)
bbcodes can (but not always do) include options, an example would be:
[URL="http://google.com"]GOOGLE[/URL]
</ EDIT >
I am currently hiding multiple variables from my string using the following method:
$result = preg_replace('/\[img\](.*)\[\/img\]/im', 'REPLACED', $qry);
$result = preg_replace('/\[url.*\](.*)\[\/url\]/im', 'REPLACED', $qry);
This works, but I would like to be able to do this with just one preg replace, and easily be able to add to it in the future if needed.
I have attempted to use:
$result = preg_replace("#\[/?(img|url)(=\s*\"?.*?\"?\s*)?]#im", 'REPLACED', $qry);
Which is only hiding the tags themselves.
How can I combine these replaces?