Skip to content

Instantly share code, notes, and snippets.

@rdapaz
Created July 13, 2018 05:06
Show Gist options
  • Save rdapaz/74a8b0e3a3bf68768843102a64a9ae0b to your computer and use it in GitHub Desktop.
Save rdapaz/74a8b0e3a3bf68768843102a64a9ae0b to your computer and use it in GitHub Desktop.
Using regular expressions in postgres queries
update "DevTest" set ip_address = (regexp_matches(description, '\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?'))[1] where vm = 'PER2RCA01' --,'PER1TFS02','PER1UFS01','PER2AADS01','PER2ICA01','PER2RCA01');
select vm, ip_address, description from "DevTest" where vm = 'PER2RCA01';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment