Re: Extracting hostname from URI column - Mailing list pgsql-sql

From Andrej Ricnik-Bay
Subject Re: Extracting hostname from URI column
Date
Msg-id b35603930709111919y475cd202gfc70d52a2db508dc@mail.gmail.com
Whole thread Raw
In response to Re: Extracting hostname from URI column  (Paul Lambert <paul.lambert@autoledgers.com.au>)
Responses Re: Extracting hostname from URI column
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Paul Lambert
Date:
Subject: Re: Extracting hostname from URI column
Next
From: Paul Lambert
Date:
Subject: Re: Extracting hostname from URI column