Discussion: ereg regexp problem
Afficher un message
Vieux 30/09/2007, 16h52   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ereg regexp problem

rallykarro@hotmail.com wrote:
> Hi,
>
> I have a problem of matching a dash(-) in the code beolow.
> Why does not the below work when matching a dash(-) but all other
> signs is correctly matched when trying?
>
> $res = ereg("^[a-zA-Z\.\-\,\/\Å\å\Ä\ä\Ö\ö\Ü\ü\ß\é\æ\ø\Æ\Ø ]+$", "-");
>
> I am running PHP Version 5.0.5 on windows.


$res = ereg("^[a-zA-Z\.\,\/ÅåÄäÖöÜüßéæøÆØ -]+$", "-");

The '-' should be last if it's to compared to, anywhere else it will be used
to mark a range.

--

//Aho
  Réponse avec citation
 
Page generated in 0,04681 seconds with 9 queries