I need some help on replacing 'nested' BBCode, preferably using [man]preg_replace[/man]

Say I have a text like:

[/quot:5e946ce841]
Hey, Howdy!!
[/quot:5e946ce841]
bla bla bla...

I want it converted to:

<quot>:-)<quot>Hi, there!
</quot>
Hey, Howdy!!
</quot>
bla bla bla...

converting '[quot]' into '<quot>' & '[/quot]' into '</quot>'

-TIA

    So have you tried searching the forums for "preg_replace" and "bbcode", or the user notes in the manual entry for [man]preg_replace[/man]?

      well infact I did, but none were helpful....
      my problem is with nested and multiple(seperate) QUOTE blocks in BBCode. Has anyone done a preg_replace for it?

        So you want to convert [quotjunk] into <quote> and [/quotjunk] into </quote>?

          yes.
          currently I'm using this:

          "/[quot(.*?)]/i" => "[quot]"

          then

          "/[quot](.*?)[\/quot]/Uis" = > ""

          but i have a problem when there is a situation like,
          FIRST quot block
          some text....
          SECOND quot block

          It isn't able to spare the "some text..." part!

            aha BTW i forgot to mention that I'm not converting it to <quot></quot> anymore.
            Instead I want to strip the text within QUOT blocks...

            sorry abt that.

            any idea of how to do it?

              Write a Reply...