hadoob024 Posted March 15, 2007 Share Posted March 15, 2007 I can't figure out what this is for the life of me. Here's the error I'm getting: Error Message: eregi() [<a href='function.eregi'>function.eregi</a>]: REG_BADBR Error Code: 2 This error corresponds to the following area of code: if (!eregi('^[a-zA-Z[:blank:].`\'\-]{1,30}$', $city)) { $problem = 5; $problemtext .= "<B>City (or Country if international) name can only be composed of the letters A through Z, and the following symbols: -, ', and `.</B><P>"; } if (!eregi('^[[:blank:][:punct:][:alnum:][:space:]]{1,500}$', $listingdescription)) { $problem = 5; $problemtext .= "<B>Listing description can only contain letters, numbers, punctuation, tabs, and spaces.</B><P>"; } Any thoughts? Quote Link to comment Share on other sites More sharing options...
benjaminbeazy Posted March 15, 2007 Share Posted March 15, 2007 try removing the $ Quote Link to comment Share on other sites More sharing options...
hadoob024 Posted March 15, 2007 Author Share Posted March 15, 2007 OK. I kinda figured something out. I think the error's in this part: {1,500} I think I can't test a value greater than 256. Is there any workaround to this? Quote Link to comment Share on other sites More sharing options...
btherl Posted March 15, 2007 Share Posted March 15, 2007 Try this: if (!preg_match('|^[[:blank:][:punct:][:alnum:][:space:]]{1,500}$|', $listingdescription)) preg is faster than ereg too.. it's a win-win situation Edit: There's no need to use eregi() rather than ereg() when you are not mentioning characters by name (or when you include both a-z and A-Z as in the first regex). eregi('A-Z') and eregi('a-z') are identical, because eregi() ignores case. Quote Link to comment Share on other sites More sharing options...
hadoob024 Posted March 15, 2007 Author Share Posted March 15, 2007 Cool. Thanks for the tip! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.