php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #518 Regex incompatibilities
Submitted: 1998-07-07 17:49 UTC Modified: 1998-07-07 17:58 UTC
From: hroberts at alumni dot prineton dot edu Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Final Release OS: Red Hat Linux 5.0
Private report: No CVE-ID: None
 [1998-07-07 17:49 UTC] hroberts at alumni dot prineton dot edu
There seems to be a glitch in the regex support.  If you compile php with
the system regex libs on RH5.0, the following line replaces all occurences
of "'" with "\'" in the given string:

****
return ereg_replace("'", "\'", $str);
****

However, if you run that same line on the same system with php compiled with its own regex library, the script just replaces single quotes with single quotes.  If you use single quotes around the \', you get the opposite behavior with each of the regex libraries (system library leaves the string alone, but the php library inserts slashed single quotes).

This may just be a glitch in the RH regex library, but it would be really nice if the php regex functions worked the same regardless of the library included.

Thanks again for such a cool application !

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-07 17:58 UTC] zeev
> This may just be a glitch in the RH regex library,
> but it would be really nice if the php regex functions
> worked the same regardless of the library included.

That would require magic, though, and is quite impossible.
If the regex libs implement stuff differently, the regex
functions will behave differently.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 02:01:29 2024 UTC