I'm looking for a Postgres (actually Redshift) equivalent to [Hive's parse\_url(..., 'HOST')](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-StringFunctions).

[Postgres docs](http://www.postgresql.org/docs/8.3/static/test-parser.html) say it has a URL parser as part of its full text search. This blog post has [a regex](http://www.jourlin.com/post/2011/07/19/A-PostgreSQL-query-to-extract-a-domain-name-from-a-URL) which may or may not be bulletproof. What is best?