You are here: Re: Is there any function in php that will match a word exactly and if it finds it, it returns true. « PHP Programming Language « IT news, forums, messages
Re: Is there any function in php that will match a word exactly and if it finds it, it returns true.

Posted by Steve on 11/12/07 17:51

<ross.oneill@gmail.com> wrote in message
news:1194732358.847042.123900@50g2000hsm.googlegroups.com...
> Thanks for your response. But if in your example
> strVar "Bob is from Canada" -- would return true when I want it to
> return false.

people shy away from regex...but, i don't know why.

/\bca(\b|$)/i

preg_match 'Bob is from Canada' returns false

preg_match 'Bill is from San Diego, CA' returns true.



you'd be hard-pressed to write anything more simple or manageable.

 

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

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