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? Link to comment https://forums.phpfreaks.com/topic/42813-eregi-reg_badbr-error/ Share on other sites More sharing options...
benjaminbeazy Posted March 15, 2007 Share Posted March 15, 2007 try removing the $ Link to comment https://forums.phpfreaks.com/topic/42813-eregi-reg_badbr-error/#findComment-207816 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? Link to comment https://forums.phpfreaks.com/topic/42813-eregi-reg_badbr-error/#findComment-207817 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. Link to comment https://forums.phpfreaks.com/topic/42813-eregi-reg_badbr-error/#findComment-207830 Share on other sites More sharing options...
hadoob024 Posted March 15, 2007 Author Share Posted March 15, 2007 Cool. Thanks for the tip! Link to comment https://forums.phpfreaks.com/topic/42813-eregi-reg_badbr-error/#findComment-207832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.