Re: REGEXP_REPLACE woes - Mailing list pgsql-general

From CaT
Subject Re: REGEXP_REPLACE woes
Date
Msg-id 20080610140243.GR2903@zip.com.au
Whole thread Raw
In response to Re: REGEXP_REPLACE woes  ("Leif B. Kristensen" <leif@solumslekt.org>)
Responses Re: REGEXP_REPLACE woes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Tue, Jun 10, 2008 at 03:43:02PM +0200, Leif B. Kristensen wrote:
> On Tuesday 10. June 2008, Leif B. Kristensen wrote:
> >Hey, I told it not to be greedy, didn't I?
>
> Found it. I must make *both* atoms non-greedy:

That makes no sense. Take this bit of perl, which works as expected:

$str = '[p=123|John Smith] and [p=456|Jane Doe]';

print "before: '$str'\n";

$str =~ s#\[p=(\d+)\|(.+?)\]#1 = $1, 2 = $2 rest of str = #;

print "after: '$str'\n";

There's a bug in your version of pcre I think as postgres would have
little to do with the regex itself (I be guessing).

--
  "Police noticed some rustling sounds from Linn's bottom area
  and on closer inspection a roll of cash was found protruding
  from Linn's anus, the full amount of cash taken in the robbery."
    - http://www.smh.com.au/news/world/robber-hides-loot-up-his-booty/2008/05/09/1210131248617.html

pgsql-general by date:

Previous
From: laser
Date:
Subject: Re: Multithreaded queue in PgSQL
Next
From: "Richard Broersma"
Date:
Subject: Strange ODBC error & statement in Server log