Jump to content

regex address problem


Stickybomb

Recommended Posts

 

 

i made this regex value

 

^[0-9]{1,5}\s[[a-zA-Z0-9]*[\sa-zA-Z0-9]*[aAvVeEsSrRdDtT]{2,3}\.?\s[nNsSeEwW][\.\s]?[nNsSeEwW][\.]?$

(1111 somewhere st se| 1111 somewhere st. s.e. | 1111 east st st. n.w.)  <-- all work in tester

 

to check an address in php running it through eregi and for some reason the regex accepts the data i am inuting in the regexlib.net teseter but it does not in my script any help with this would be great

 

 

 

thks

 

stickybomb

 

Link to comment
Share on other sites

i did what you said in the other post, but it gave me an error. it did not like the whole\z thing and then no matter what i did it gave me a end delimiter error. so i revamped the regex and tried it with eregi again, the other values worked fine though. So basically using preg this regex does not work either. I am sorry if i am a little troublesome i am completely new to the use of regex. in the other post you said not to use shorthand? what exactyl is shorthand, of this I was unsure.

 

 

Link to comment
Share on other sites

Warning: No ending delimiter '^' found

 

In addition to the docs, see these for an explanation of delimiters:

 

http://www.phpfreaks.com/forums/index.php/topic,126178.msg524875.html#msg524875

http://www.phpfreaks.com/forums/index.php/topic,95777.0.html

 

also if \s is shorthand what is the non shorthand for a white space.

 

[ \f\n\r\t\v]

 

If you're working with Unicode, use \p{Z}

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.