php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32314 Regular Expression
Submitted: 2005-03-15 12:11 UTC Modified: 2005-03-15 12:43 UTC
From: ostap333 at hotmail dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.0.3 OS: WindowsXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ostap333 at hotmail dot com
New email:
PHP Version: OS:

 

 [2005-03-15 12:11 UTC] ostap333 at hotmail dot com
Description:
------------
Hi
I was parsing the FreeDB and fouund that lots of regular expression combinations are not working as they would in perl.
Here is one example:




Reproduce code:
---------------
$word='?? 1 ????';
if (preg_match('/^(\D+?) +?(\d{1,}) +?(\D+?)$/',$word,$match))
{
   print "$match[1]\n$match[2]\n$match[2]\n";
};
//If i remove the '^' and '$' - it works 
//But than expression is not exactly what i want coz it 
//begins to match other stuff in different strings.




Expected result:
----------------
??
1
????


Actual result:
--------------
nono..nothing niks

given code works perfectly in perl

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-15 12:43 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. 

Even if you think it is not a bug, we often know better than you,
please consult the support channels first before even considering
to reopen this report.

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC