Re: SUBSTRING for a regular expression - Mailing list pgsql-general

From
Subject Re: SUBSTRING for a regular expression
Date
Msg-id 3659.192.168.123.254.1089129230.squirrel@$HOSTNAME
Whole thread Raw
In response to SUBSTRING for a regular expression  (<btober@computer.org>)
List 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




pgsql-general by date:

Previous
From: "Chris Smith"
Date:
Subject: Re: Interpreting query plan
Next
From: Bruce Momjian
Date:
Subject: Re: Do we need more emphasis on backup?