php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40219 my bad
Submitted: 2007-01-24 15:08 UTC Modified: 2007-01-25 06:22 UTC
From: oliver dot christen at camptocamp dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.2.0 OS: windows server 2003
Private report: No CVE-ID: None
 [2007-01-24 15:08 UTC] oliver dot christen at camptocamp dot com
Description:
------------
when using preg_match, the end delimiter of regexp expression is now expected to be ^, breaking all compability.

shouldnt the end delimiter be '$' ?


Reproduce code:
---------------
preg_match ("^(.+)$", 'foo', $regs);

print_r($regs); 

Expected result:
----------------
Array
(
    [0] => foo
    [1] => foo
)

Actual result:
--------------
Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in C:\[..cut..]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-24 15:18 UTC] user at devnull dot org
Read the documentation, you need delimiters around the expression. Since ^ is the first character its making that the delimiter.

/^(.+)$/ works.
 [2007-01-24 15:20 UTC] tony2001@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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2007-01-25 06:18 UTC] oliver dot christen at camptocamp dot com
well, I get an error, so it doesnt work, right?
maybe if you can tell me in which version it work, I will try that.
 [2007-01-25 06:22 UTC] oliver dot christen at camptocamp dot com
nevermind, just noticed the /  /
sorry and thx for your help
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 04:01:28 2024 UTC