I have no idea what "regex" is, but I found an example where I only have one Code code inside a reply.

Attachment 1 is how now looks like (beta 1).
Attachment 2 is how it looked like in UBB.classic.
Attachments
48-ubb7beta1-code-error-2-ubb7beta1.gif 49-ubb7beta1-code-error-2-ubbc.gif