Everything that handles formatting (BBCodes, links, smilies, etc...) has been completely rewritten between phpBB 3.1 and 3.2. You can read about it in this topic from 2013
. You have no idea how infuriating it is when somebody randomly asks something like "Why was it made this complicated?"
as if someone with too much time on their hands went "oh, this is too easy I'm going to make it unnecessarily harder on myself and everybody."
The old BBCodes worked via basic string replacement. Little did you know, every time you created a custom BBCode, you were actually writing a regexp. That's because the code responsible for it would adjust the BBCode definition so it would become a valid regexp with the proper dynamic replacements. Incidentally, this requires to run generated code. This used to be done via the
e pattern modifier
. That modifier was deprecated in PHP 5.5 and removed from PHP 7.0 a few years ago.
The new BBCodes work via a PHP parser and a templating language. Most people don't need to know about the details and can keep using their old configuration because BBCode definitions are analysed and used to generate a proper configuration for the parser, while BBCode templates are quietly transformed into XSL templates. When there is more than one definition for a BBCode, an algorithm merges the two definitions into one that hopefully can be used for both usage. There are two strategies for the merge: one that is suitable for BBCodes such as
and one that is suitable for those like
. In the case of your
BBCode, the wrong one was selected. I'll see if the algorithm can be improved to better detect that kind of BBCodes.
I looked at your handcrafted definition. It looks fine and I don't think you will have to reparse the old posts. Have you tried displaying old posts to see whether they are correct?