|  | 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] |