#27689 [Opn->Bgs]: preg_replace " glitch
| From: | derick@php.net | Date: | Thu, 25 Mar 2004 14:39:46 +0000 |
| Subject: | #27689 [Opn->Bgs]: preg_replace " glitch | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56814@lists.php.net to get a copy of this message | ||
ID: 27689
Updated by: derick@php.net
Reported By: slunta at msn dot com
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Linux
PHP Version: 4.3.4
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Something in your regexp is fishy.
Previous Comments:
------------------------------------------------------------------------
[2004-03-25 02:05:35] slunta at msn dot com
Description:
------------
There is a glitch, that does not allow " to be used in
preg_replace, not being replaced at all. Here's what I mean:
Here is a preg_replace code, the input, and output that should be
received, listed below in these text boxes I filled out
Reproduce code:
---------------
$input=htmlentities('<size="100%">This is a code that will change
font-size using <span> tags, user-friendly style.</size>');
// This is supposed to do the proper replaces
$output=preg_replace('/<size="(.+)">(.+)<\/size>/iU','<span
style="font-size: $1;">$1</span>',$input);
Expected result:
----------------
//Now, here is what the script is supposed to output
echo '<span style="font-size: 100%">This is a code that will change
font-size using <span> tags, user-friendly style.</span>';
Actual result:
--------------
echo '<size="100%">This is a code that will change
font-size using <span< tags, user-friendly style.</span>';
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27689&edit=1