You are here: Re: I can not match "&" - regexp « PHP Programming Language « IT news, forums, messages
Re: I can not match "&" - regexp

Posted by Rik on 04/26/07 17:29

no@email.com wrote:
> Papkin wrote:
>> Hi
>>
>> if (
>> eregi("^[\&/[:space:]/a-zA-Z0-9±ęćłń󶿼ˇĆĘŁŃÓ¦¬Ż\.\/\/-]{2,65}$","Merry
>> & Cat") )
>> return true;
>> else
>> return false;
>>
>> I'd like to match also "&" but this regexp above does not do this,
>> adding \& does not help. Any ideas?
>>
>> Thank you
>
> i see some pretty wild characters there.
> give it a try with this
>
> eregi('[a-z]+ \& [a-z]+', 'Merry & Cat')
>


Or use preg_match:

preg_match('|^[\s&a-z0-9±ęćłń󶿼ˇĆĘŁŃÓ¦¬Ż./\\-]{2,65}$|i',$string);

--
Rik Wasmus

Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!

 

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

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