I have the following address that I pulled from a database. I am trying to clear everything up until ST|AVE|BLVD. I am trying to get rid of 1ST or the random 1.
So that it reads: 1. 9999-1000 N CLARK ST 2. 4567-5678 W BELMONT AVE 3. 1200 N HAMLIN AVE 4. 8220 W CERMAK RD 5. 1240 W 69TH ST 6. 7901 W ADDISON ST
You can try the following regex:
^(.*?)(\s*(?:ST|AVE|BLVD).*)$
Your data is in capturing group 1.
See example here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.