Jump to content

Regular expression help

Featured Replies

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?

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 :)

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.