|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-05 04:00 UTC] gerzson@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
Perl regexps are greedy by default. \d+ will get all decimals possible (\d+? will only find one - it's lazy). It seems preg_match is not greedy by default. code: preg_match("/^\w+(\d+)$/", $change_link, $change_id); print("My ID is $change_id[1]<BR>"); when passed: "edit11" change_id[1] is equal to "1". It should be equal to "11" especially when my regexp is looking for the end of the line ($) after it!