MyBB Community Forums

Full Version: Custom BBcode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Mybb custom bbcode editor allows to create bbcodes like this:

[bbcode]sometext[/bbcode]

And then display them as for example:

<div>$1</div> where $1 = sometext

But how to create a bbcode with tite (with two variables) like this:

[bbcode=sometitle]sometext[/bbcode]

So it would look like:

<div>$1 $2</div> where $1 = sometitle $2 =sometext

How to do so?
In regular expression insert this code:
\[bbcode=([a-zA-Z0-9]+)\](.*?)\[/bbcode\]
and in replace this:
<div>$1 $2</div>
Unforutnately it is not working.

In "Testing" field I wrote:

[bbcode=testtitle]testtext[/bbcode]

And hitting "Test" shows the same text. It replace nothing (
Sorry, my mistake.
This is the correct code:
\[bbcode=([a-zA-Z0-9]+)\](.*?)\[/bbcode\]
Thanks, That is working! By the way, do you know, how to figure out this problem (connected to mybb too): http://community.mybb.com/thread-196678.html