Re: Extracting hostname from URI column

From: chester c young <chestercyoung(at)yahoo(dot)com>
To: Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au>
Cc: sql pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Extracting hostname from URI column
Date: 2007-09-12 03:47:01
Message-ID: 139773.62590.qm@web54303.mail.re2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> >> I'm trying to use substr() and position() functions to extract the
> >> full host name (and later a domain) from a column that holds URLs.
> >
> > substring( href from '.*://\([^/]*)' );
> >

typo: no backslash in front of left paren
substring( href from '.*://([^/]*)' )

match up thru //
within parens, match anything except /

return match within parens


____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Paul Lambert 2007-09-12 03:53:24 Re: Extracting hostname from URI column
Previous Message ogjunk-pgjedan 2007-09-12 03:16:15 Re: Extracting hostname from URI column