regexp_replace() [noindex] thing

From: Marcus Engene <mengpg2(at)engene(dot)se>
To: POSTGRESQL <pgsql-general(at)postgresql(dot)org>
Subject: regexp_replace() [noindex] thing
Date: 2008-09-25 15:42:41
Message-ID: 48DBB171.3090001@engene.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

I'm using tsearch2 and sometimes there are blocks of text that shouldn't
be indexed.

There is a trigger function that gathers data from the usual suspects
and updates the index. in this trigger, I'd like to exclude thing in a
[noindex] tag:
select
regexp_replace
('innan[noindex]apa[/noindex]klas[noindex]banan[/noindex]',
'(\\\[noindex\\\])+.*?(\\\[/noindex\\\])+',
' ')
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.

Could someone please point me in the general direction here?

Best regards,
Marcus

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A B 2008-09-25 15:51:37 My first revoke
Previous Message Jeff Amiel 2008-09-25 15:42:19 Re: The planner hates me.