I have been trying for a while to parse bbcode URL tags in JavaScript.
For example,
[url=http://examp.le]linktext[/url]
should become
<a href="http://examp.le">linktext</a>.
I have done much research on this and have an awful understanding of regexes. So the question is, how can I do this?


[b]bold [u]underlined and bold[/b] wut[/u]. This should not be parsed like<strong>bold <u>underlined and bold</strong> wut</u>since that HTML isn't valid.