Re: Extracting hostname from URI column

From: Alvaro Herrera <alvherre(at)commandprompt(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 12:52:03
Message-ID: 20070912125203.GC4979@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Paul Lambert wrote:
> Andrej Ricnik-Bay wrote:
>
>> 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
> Thanks - that makes a bit more sense. I'm in the middle of reading chapter
> 9.3.7 of the manual - POSIX Regular Expressions - which I'm assuming is
> dealing with this, so it's looking clearer.

A very good resource on regular expressions is "Mastering Regular
Expressions" by Jeffrey Friedl, now in its third edition:
http://www.oreilly.com/catalog/regex3/

I read the first ed. years ago and it was very illuminating.

--
Alvaro Herrera Developer, http://www.PostgreSQL.org/
"Acepta los honores y aplausos y perderás tu libertad"

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Osvaldo Rosario Kussama 2007-09-12 14:22:12 Re: Simple Query?
Previous Message Paul Lambert 2007-09-12 04:03:07 Re: Extracting hostname from URI column