yekibud Posted September 4, 2008 Share Posted September 4, 2008 I've got descriptive address strings like this: 1. 2. 104 N Main Street, 3rd floor Masonic Bldg 3. West Water Street next to Bobbys Auto Sales 4. 436 Industry Rd 1/2 M from US 27 South of 5. 111 Bridge St off US 31W @ N end of 6. Main Street over Blue Daisey Flower Shop 7. 112 S. Main Street WILLIAMSTOWN 8. Hwy 55, Springfield Rd & Corporate Drive 9. US Highway 68 West, behing Subway CADIZ 10. etc., that I have to parse the street address from. I was thinking of coming up with my own regex, but then I got tired of writing all the possibilities for Rd, Rd., Road, St, St., Street, and so on. Not to mention the other complexities. Then I thought there must be some generic libraries to help me out here. I found Geo::StreetAddress::US in CPAN, which I guess I could get to work - but I wanted to check if there was anything natively in PHP to help me out. Thanks for the tips. Quote Link to comment Share on other sites More sharing options...
effigy Posted September 5, 2008 Share Posted September 5, 2008 See this topic. My solution is at the bottom. Quote Link to comment Share on other sites More sharing options...
yekibud Posted September 5, 2008 Author Share Posted September 5, 2008 Thanks for your response, effigy! I did glance at that post, but I was wondering if there weren't some regex libraries out there that you could import for common parsing issues, like this one. Seems like there should be. Guess I'll just have to start building my own. I'll give your solution a try - thanks again! 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.