[postgis-users] Any robust regex for searching out addresses?

Jo winfixit at gmail.com
Sun May 3 11:43:23 PDT 2020


It would help if you had a bigger sample of valid addresses.

This may be a good starting point:

(\d+)(\w*)(-)?(\d+)(\w*)(\s)([\w\s]+),\s?([\w\s]+),\s?([\w\s]+)

https://pythex.org/?regex=(%5Cd%2B)(%5Cw*)(-)%3F(%5Cd%2B)(%5Cw*)(%5Cs)(%5B%5Cw%5Cs%5D%2B)%2C%5Cs%3F(%5B%5Cw%5Cs%5D%2B)%2C%5Cs%3F(%5B%5Cw%5Cs%5D%2B)&test_string=223A-5D%20Great%20Avenue%2C%20A%20City%2C%20Planet%20Earth&ignorecase=0&multiline=0&dotall=0&verbose=0


Jo

On Sun, May 3, 2020 at 2:30 PM Shaozhong SHI <shishaozhong at gmail.com> wrote:

> Hello,
>
> Any robust regex for searching out addresses?
>
> The text patterns is as follows:
>
> 223A-5D Great Avenue, A City, Planet Earth
>
> A robust regex needs to be constructed and tested.
>
> Any clue?
>
> Regards,
>
> Shao
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200503/9f88f42f/attachment.html>


More information about the postgis-users mailing list