Cap'n Refsmmat Posted October 1, 2005 Posted October 1, 2005 I'm trying to achieve a better BBCode parser (for my wiki) using regex to do tables. At the moment, I have a table command and such, but it does not allow attributes like a real table. What I want is a simple preg function that allows the parser to detect a [table] tag and convert it directly to html, including any attributes inside it (all of the attributes are converted raw). The same goes for [row], [data], and [heading] commands, but those would simply be tweaked versions of the table tag. Anybody willing to help?
Dave Posted October 2, 2005 Posted October 2, 2005 Sure, why not. In my opinion, the easiest way of doing this is by use of the 'e' selector that you get with PCRE. i.e. do a preg for the [table] tag, then pass the contents to a function which parses the interior. Shouldn't be too hard
Cap'n Refsmmat Posted October 2, 2005 Author Posted October 2, 2005 Thanks dave, but Aeternus gave me a nifty solution for it as well. Works rather nicely. I should get myself to learn proper regex some day.
Dave Posted October 5, 2005 Posted October 5, 2005 Damn that Aeturnus fellow. I can see I'm going to have to G:Line him and his silly regex fixes
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now