Created
July 13, 2018 05:06
-
-
Save rdapaz/74a8b0e3a3bf68768843102a64a9ae0b to your computer and use it in GitHub Desktop.
Using regular expressions in postgres queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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