pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrej Ricnik-Bay <andrej.groups@gmail.com>
To: Paul Lambert <paul.lambert@autoledgers.com.au>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: Extracting hostname from URI column
Date: Wed, 12 Sep 2007 14:19:12 +1200
Message-ID: <b35603930709111919y475cd202gfc70d52a2db508dc@mail.gmail.com> (raw)
In-Reply-To: <46E73D1C.4020009@autoledgers.com.au>
References: <335491.75226.qm@web54303.mail.re2.yahoo.com>
	<46E73D1C.4020009@autoledgers.com.au>

On 9/12/07, Paul Lambert <paul.lambert@autoledgers.com.au> wrote:
> > substring( href from '.*://\([^/]*)' );

> Ok, your solution looks better than mine... but I have no idea how to
> interpret that, time to consult some manuals.
Plain regex.... The key are the parenthesis () ...
basically it will omit ANYTHING + two slashes at the beginning
of a string.  Then it will match everything BUT a slash, and as
much of that as possible since regex are greedy by default
(hence the host name he was looking for) ... and everything
AFTER a slash will be omitted.



Cheers,
Andrej


-- 
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm



view thread (17+ messages)  latest in thread

Message-ID: <b35603930709111919y475cd202gfc70d52a2db508dc@mail.gmail.com>
Permalink:  ../b35603930709111919y475cd202gfc70d52a2db508dc@mail.gmail.com/
Also on:    postgresql.org/message-id/b35603930709111919y475cd202gfc70d52a2db508dc@mail.gmail.com

 · 

reply

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: andrej.groups@gmail.com, paul.lambert@autoledgers.com.au
  Subject: Re: Extracting hostname from URI column
  In-Reply-To: <b35603930709111919y475cd202gfc70d52a2db508dc@mail.gmail.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