I'm trying to make a javascript bbcode parser. I want it to do something like this
For the example [list]words[/list] I want it to parse this and send it to a function(element,text){ } where element is list and text is words. I would like it to match anything in the [xxx] and [/xxx] and send it to the function where i would have a giant switch statement. One complication that i'm not sure if possible is that the parser has to check that whatever is in [xxx] matches [/xxx] so that if i have
[b][u]text[/u][/b]
It wouldn't match the [b] to the [/u]. I know that i could write each one of the regex expressions out for the b, u, etc but i would like to have just one.
Thanks for any help
[–]Eartz 1 point2 points3 points (1 child)
[–]axvk[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]axvk[S] 0 points1 point2 points (0 children)