Created
August 20, 2013 21:48
-
-
Save sposmen/6287781 to your computer and use it in GitHub Desktop.
Select from an XML the img src
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
| select id, url from | |
| ( | |
| select id, array_to_string(regexp_matches(possible, 'src=[\s\\]*"(https?:\/\/.*)"', 'g'), ',') as url | |
| from ( | |
| select id, array_to_string(regexp_matches(xml::text , '(<img .*?>)', 'g'), ',') as possible from victorious_squirrel_widgets | |
| where xml::text ~ '(<img .*?>)' | |
| ) as foo | |
| ) as foo2 | |
| where url not like '%URL_NOT_NEEDED%' | |
| order by id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment