Re: How to extract a substring using Regex

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: "Postgres User" <postgres(dot)developer(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to extract a substring using Regex
Date: 2007-08-24 00:43:51
Message-ID: DA2AB8BA-73D4-4668-AF0D-CA7B0B332EC3@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 23, 2007, at 19:33 , Postgres User wrote:

> I'm new to Regex in Postgres. Can someone give me a quick pointer on
> how I'd SELECT the substring between '<name>' and '</name>' in
> a field?

Check out regexp_replace:

http://www.postgresql.org/docs/8.2/interactive/functions-
matching.html#FUNCTIONS-POSIX-REGEXP

One of the forms of substring might work for you, too.

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Postgres User 2007-08-24 00:49:58 Re: How to extract a substring using Regex
Previous Message Postgres User 2007-08-24 00:33:17 How to extract a substring using Regex