You are here: Re: help understanding an ereg expression « PHP Programming Language « IT news, forums, messages
Re: help understanding an ereg expression

Posted by Palle Hansen on 01/19/06 10:23

yawnmoth wrote:

> if (eregi("^[a-z0-9| |\,\-\+\.]+$",$string))

> Why does $string = 'te\st' yield a match? The ereg expression doesn't
> have a \\ in it...

To have this expression make sence to me, it should look like

if (eregi("^[a-z0-9 ,+.-]+$",$string)){

'-' should be the first og last character

all the special characters looses their meaning in a character class.
so you acually have 4 maching backslashes in the expression

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация