From: chester c young <chestercyoung@yahoo.com>
To: Paul Lambert <paul.lambert@autoledgers.com.au>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: Extracting hostname from URI column
Date: Tue, 11 Sep 2007 20:47:01 -0700 (PDT)
Message-ID: <139773.62590.qm@web54303.mail.re2.yahoo.com> (raw)
In-Reply-To: <46E73D1C.4020009@autoledgers.com.au>
> >> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: chestercyoung@yahoo.com, paul.lambert@autoledgers.com.au
Subject: Re: Extracting hostname from URI column
In-Reply-To: <139773.62590.qm@web54303.mail.re2.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox