php-pcre - Bug?

Daniel Mróz beorn at alpha.pl
Sat Apr 26 00:54:51 CEST 2003


Czesc

   Albo ja czegos nie rozumiem, albo pcre jest walniete:


[beorn at mei blah]$ cat test.php
<?
   if (preg_match('/[0-9]{2}:[0-9]:[0-9]/', '123:3:12'))  {
      print("YES\n");
   } else {
      print("NO\n");
   }
?>
[beorn at mei blah]$ php test.php
X-Powered-By: PHP/4.2.3
Content-type: text/html

YES


Przeciez za `man perlre':

[...]
   {n}    Match exactly n times
[...]


php-pcre traktuje `{n}' jak `{n,}' (przy stringu '1:3:12' wypisuje
`NO'), a `[0-9]' traktuje jako dowolna ilosc cyfr zamiast tylko
jednej. Tak ma byc?


Pozdrawiam
Beorn

-- 
----------------------------------------------------------------------
Daniel `Beorn' Mróz      <beorn at alpha.pl>       http://127.0.0.1/beorn
GCS/E d-(pu) s-:- a--@ C++++ UL++++$ P+++ L+++ E--- X W+>++ N+++ o? K-
w---  O M- V- PS PE- !Y PGP+ t- 5- R tv-- b+ DI++ D+++ G++ e h! r++ y?
----------------------------------------------------------------------



More information about the pld-devel-pl mailing list