From: | CaT <cat(at)zip(dot)com(dot)au> |
---|---|
To: | "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: REGEXP_REPLACE woes |
Date: | 2008-06-10 14:02:44 |
Message-ID: | 20080610140243.GR2903@zip.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Fuhr | 2008-06-10 14:07:07 | Re: REGEXP_REPLACE woes |
Previous Message | Leif B. Kristensen | 2008-06-10 13:43:02 | Re: REGEXP_REPLACE woes |