<div dir="ltr">It would help if you had a bigger sample of valid addresses.<div><br></div><div>This may be a good starting point:</div><div><br></div><div>(\d+)(\w*)(-)?(\d+)(\w*)(\s)([\w\s]+),\s?([\w\s]+),\s?([\w\s]+)</div><div><br></div><div><a href="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">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</a>  <br><div><br></div><div>Jo</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 3, 2020 at 2:30 PM Shaozhong SHI <<a href="mailto:shishaozhong@gmail.com">shishaozhong@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Any robust regex for searching out addresses?</div><div><br></div><div>The text patterns is as follows:</div><div><br></div><div>223A-5D Great Avenue, A City, Planet Earth<br></div><div><br></div><div>A robust regex needs to be constructed and tested.</div><div><br></div><div>Any clue?</div><div><br></div><div>Regards,</div><div><br></div><div>Shao</div></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>