From:             bartwared2 at planet dot nl
Operating system: Linux, apache 1.3.29
PHP version:      4.3.4
PHP Bug Type:     Unknown/Other Function
Bug description:  Error in eregi_replace(...)

Description:
------------
I have been trying to get the  eregi_replace  function to remove \\ from
my string. I have also tried ereg_replace. Every time I try to it fails.
This *is* a bug.In http://bugs.php.net/bug.php?id=26524 was said that it
isn't, but I'm sure it is.



We all know, to print a \ on the screen we can use this:

 print("\\");



This works, ofcourse. Try it.

But when you try to use eregi_replace to replace a \, it will give the
following error: 



Warning: eregi_replace(): REG_EESCAPE in /where-ever.php on line 5



There is nothing diffrent from my host to any others, and more people have
this problem, I think.



Try this:



<?php

    $description = "Hi, \\how are you?";

    $description = eregi_replace("\\", " ", $description);

?>

Reproduce code:
---------------
$description = "Hi, \\how are you?";

$description = eregi_replace("\\", " ", $description);

Expected result:
----------------
I expected $description to become "Hi,  how are you", but instead of that
I got...

Actual result:
--------------
Warning: eregi_replace(): REG_EESCAPE in
/home/bartware/public_html/bart-ware.com/admin.php on line 188



Line 188 is: $description = eregi_replace("\\", " ", $description);

-- 
Edit bug report at http://bugs.php.net/?id=27705&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27705&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27705&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27705&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27705&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27705&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27705&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27705&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27705&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27705&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27705&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27705&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27705&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27705&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27705&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27705&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27705&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27705&r=float

Reply via email to