Re: SUBSTRING for a regular expression

From: <btober(at)computer(dot)org>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: SUBSTRING for a regular expression
Date: 2004-07-06 15:53:50
Message-ID: 3659.192.168.123.254.1089129230.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>
> SELECT
> SUBSTRING(description FROM '(.*), \\d{1,3},') AS vname,
> SUBSTRING(description FROM '.*, (\\d{1,3}),') AS age,
> SUBSTRING(description FROM '\\d{1,3}, of (.*?),? was charged') AS
> address, SUBSTRING(description FROM ' was charged ([^ ]+)') AS dow,
> SUBSTRING(description FROM ' was charged [^ ]+ with (.+)') AS charge
> FROM police_log;

Aha! The old double-slash escape. Thank you very much.

--Berend Tober

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2004-07-06 16:04:05 Re: Do we need more emphasis on backup?
Previous Message ruben 2004-07-06 15:43:20 Re: server closed the connection unexpectedly