note 33281 deleted from function.preg-match-all by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 12:23:37 +0000 |
| Subject: | note 33281 deleted from function.preg-match-all by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57441@lists.php.net to get a copy of this message | ||
Note Submitter: malone@N0SPAM.vwmark.com
----
In addition to my previous note, the following expression:
preg_match_all('/<([\w]+).* (.*=)(\#(?:[A-F]|[0-9]){6}).*>/i',
preg_replace('/"/', '', $template_string), $template_colours_6char);
will yield an additional array listing how each colour tag is applied:
Array
(
...
[2] => Array
(
...
[2] => bgColor=
[3] => borderColor=
...
)
...
)
Replacing (.*=) with (.*color=) will also work fine as long as you don't forget to add the
caseless /i at the end of the preg expression.