|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-15 12:43 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 09:00:01 2025 UTC |
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