XF 1.4 How to create simple custom bbcode


Active member
I'm trying to create a simple bbcode where I can do something like:
[bbcode=123 myoption=123 myoption2=123][/bbcode]
and have this show as some html but able to use the three numbers as part of the html and the two options are optional.

I know I need to use the Option Match Regular Expression, but I can seem to get it to work.


XenForo developer
Staff member
A custom BB code only has one option -- anything after the first equals. In your example, this would be "123 myoption=123 myoption2=123". If you want to split this up to access the parts separately, you need to use a PHP callback.