Rather than selecting rows based on whether their string value equals a given regular expression input, I want to select rows with regular expressions that match a given string input.
As far as purpose, I'm am trying to identify website names from input URLs.
TABLE
WEBSITE REGEX
The New York Times ^.+\.nytimes.com.*$
Is there a good way to do this? I'm using postgres, and I was hoping to avoid large loops.
Thanks!
SELECT * FROM TABLE where 'http://www.nytimes.com/foo/' ~ REGEX- Though I admit I haven't actually tried it.