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

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

Super!

Best regards,
Marcus


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: The planner hates me.
Next
From: Christopher Browne
Date:
Subject: Re: [Slony1-general] Re: Stripping out slony after / before / during pg_restore?