Jump to content

eregi() REG_BADBR error???


hadoob024

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.