Skip to content

Instantly share code, notes, and snippets.

@vithalsamp
Created February 26, 2018 04:22
Show Gist options
  • Save vithalsamp/ea3f31fc9419230d121f1648dc67d49d to your computer and use it in GitHub Desktop.
Save vithalsamp/ea3f31fc9419230d121f1648dc67d49d to your computer and use it in GitHub Desktop.
training=# select REGEXP_SUBSTR(string, '(^|[^[:word:]]|[[:space:]])\\d{6}([^[:word:]]|[[:space:]]|$)') from (select 'My zip is 12345 and id is 389362 . Send details to my house # 8/22' as string) a ;
regexp_substr
---------------
389362
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment