You are here: Re: Warning: ereg(): REG_BADBR « PHP Programming Language « IT news, forums, messages
Re: Warning: ereg(): REG_BADBR

Posted by Kimmo Laine on 04/28/06 15:14

<millw0rm@gmail.com> wrote in message
news:1146208077.913936.287620@j73g2000cwa.googlegroups.com...
> why i m getting error here???
>
> Warning: ereg(): REG_BADBR
>
>
> code:
> if(!ereg("^(.){15,400}$",$string)) {

^
It just occured to me, the dollar sign inside double quotes " " should
propably be escaped, otherwise php might confuse it for a variable marker,
but the variable is missing. for example: "$cat" replaces $cat with the
value of the variable. here you have "$". Either escape it or use single
quotes. "^(.){15,400}\$" or '^(.){15,400}$'. But as I already said, using
strlen is much more simple way. If you have to use the regular expression
(can't think of a reason why though), you can fix it with that.

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

 

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

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