Stickybomb Posted February 19, 2007 Share Posted February 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
effigy Posted February 19, 2007 Share Posted February 19, 2007 ...running it through eregi... See this post again. Quote Link to comment Share on other sites More sharing options...
Stickybomb Posted February 20, 2007 Author Share Posted February 20, 2007 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. Quote Link to comment Share on other sites More sharing options...
effigy Posted February 20, 2007 Share Posted February 20, 2007 What kind of error? I'm guessing it was about delimiters since ereg does not use them, while preg does. Shorthands are the \letter notations; see this for more information. In preg \s matches whitespace; in ereg \s matches "s". Quote Link to comment Share on other sites More sharing options...
Stickybomb Posted February 20, 2007 Author Share Posted February 20, 2007 the error with preg its giving me is Warning: No ending delimiter '^' found this is using the same regex above also if \s is shorthand what is the non shorthand for a white space. Quote Link to comment Share on other sites More sharing options...
effigy Posted February 20, 2007 Share Posted February 20, 2007 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} 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.