Re: regexp_replace() [noindex] thing - Mailing list pgsql-general

From Tom Lane
Subject Re: regexp_replace() [noindex] thing
Date
Msg-id 8321.1222360500@sss.pgh.pa.us
Whole thread Raw
In response to regexp_replace() [noindex] thing  (Marcus Engene <mengpg2@engene.se>)
Responses Re: regexp_replace() [noindex] thing  (Marcus Engene <mengpg2@engene.se>)
List pgsql-general
Marcus Engene <mengpg2@engene.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

pgsql-general by date:

Previous
From: Reg Me Please
Date:
Subject: Counting rows in a PL/PgSQL CURSOR without fetching?
Next
From: Tom Lane
Date:
Subject: Re: The planner hates me.