MyBB Community Forums
[How To?] Custom BBcode - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] Custom BBcode (/thread-196676.html)



Custom BBcode - CMTV - 2016-07-30

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?


RE: Custom BBcode - chack1172 - 2016-07-30

In regular expression insert this code:
\[bbcode=([a-zA-Z0-9]+)\](.*?)\[/bbcode\]
and in replace this:
<div>$1 $2</div>



RE: Custom BBcode - CMTV - 2016-07-30

Unforutnately it is not working.

In "Testing" field I wrote:

[bbcode=testtitle]testtext[/bbcode]

And hitting "Test" shows the same text. It replace nothing (


RE: Custom BBcode - chack1172 - 2016-07-30

Sorry, my mistake.
This is the correct code:
\[bbcode=([a-zA-Z0-9]+)\](.*?)\[/bbcode\]



RE: Custom BBcode - CMTV - 2016-07-30

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