note 102779 deleted from function.bbcode-create by danbrown
| From: | danbrown@php.net | Date: | Sun, 06 Mar 2011 14:12:54 +0000 |
| Subject: | note 102779 deleted from function.bbcode-create by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-177593@lists.php.net to get a copy of this message | ||
Note Submitter: tbrisbane at hotmail dot nospammyspam dot com
----
It should be noted that rothenbergxxx at gmail dot com's regex will only work for single line
$innertext. While this is perfectly fine for the majority of the tags, quote tags need multi-line
$innertext.
Here is a fixed version of the regex which supports multi-line $innertext between the opening and
closing tags:
preg_match_all('
\[(.+?)=?(.*?)\]([\s\S]+?)\[/\1\]', $string, $matches)
In my tests, this performs without error. Feel free to post any additional corrections.