php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23662 ereg_replace doesn't follow specs
Submitted: 2003-05-16 13:25 UTC Modified: 2003-05-16 14:36 UTC
From: jesse at eonstreet dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.1 OS: XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jesse at eonstreet dot com
New email:
PHP Version: OS:

 

 [2003-05-16 13:25 UTC] jesse at eonstreet dot com
These lines of code seem to be invalid:

$text = "tes test tester";

$text = ereg_replace("^tes$","",$text);

echo $text;
// ouptu is | tes test tester |

I've test this with every possible combination of acceptable ereg associations and nothing... I've stopped using ereg and only now use preg functions.

Can anyone explain why this does work?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-16 14:36 UTC] derick@php.net
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.

^ means beginning of sentence
$ means end of sentence

you were only matching the exact string \"tes\" here.

	
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 31 06:00:03 2025 UTC