Re: regexp_replace() [noindex] thing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marcus Engene <mengpg2(at)engene(dot)se>
Cc: POSTGRESQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: regexp_replace() [noindex] thing
Date: 2008-09-25 16:35:00
Message-ID: 8321.1222360500@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marcus Engene <mengpg2(at)engene(dot)se> writes:
> I would like to have a function like the above that returns "innan klas"
> for this data. I would have expected it to as I use the non greedy version.

regression=# select
regexp_replace
('innan[noindex]apa[/noindex]klas[noindex]banan[/noindex]',
'\\[noindex\\].*?\\[/noindex\\]',
' ', 'g');
regexp_replace
----------------
innan klas
(1 row)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-09-25 16:41:52 Re: The planner hates me.
Previous Message Reg Me Please 2008-09-25 16:31:05 Counting rows in a PL/PgSQL CURSOR without fetching?