ereg regexp problem

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 =3D ereg("^[a-zA-Z\.\-\,\/\=C5\=E5\=C4\ä\=D6\ö\=DC\ü\ß\= E9\=E6=
\=F8\=C6\=D8 ]+$", "-");

I am running PHP Version 5.0.5 on windows.

thanks,

//Karolina
rallykarro [ So, 30 September 2007 14:10 ] [ ID #1832751 ]

Re: ereg regexp problem

rallykarro [at] 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
Shion [ So, 30 September 2007 17:52 ] [ ID #1832754 ]
PHP » alt.php » ereg regexp problem

Vorheriges Thema: the usort 's puzzle
Nächstes Thema: url and no php file see