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
https://forums.phpfreaks.com/topic/39222-regex-address-problem/
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
https://forums.phpfreaks.com/topic/39222-regex-address-problem/#findComment-189428
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
https://forums.phpfreaks.com/topic/39222-regex-address-problem/#findComment-189674
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.