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

Posted by yawnmoth on 01/19/06 07:36

Say I have the following script:

<?
$string = 'test';
if (eregi("^[a-z0-9| |\,\-\+\.]+$",$string))
{
echo 'matches!';
}
else
{
echo 'no match';
}
?>

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

Also, what does | | do? Normally, it'd mean 'or', but inside of []'s?
And two of them?

 

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

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