Possible Duplicate:
bbcode unparser regex help
I want to convert this HTML code
<div class="postQuote"> <div class="postQuoteAuthor"><a href="http://www.siteurl.com/profile.php?user=Username">Username</a> wrote...</div> quoted text</div> comment
to bbcode ..
[QUOTE=Username] quoted text [/QUOTE] comment
I don't want a tutorial about creating bbcode , it is already setup , i just want to know how to match and replace .. to make text compatible with the new board