regexp_replace() function in new version

From: Abhijeet <abhijeetrathod262(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: regexp_replace() function in new version
Date: 2007-11-14 13:53:13
Message-ID: ab3ea55b0711140553l4c5f9368jfc3b181d2fa580e9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

regexp_replace() function in new version of PostgreSQL is giving error.

I am trying to remove tags from string.

I have tried following regex in & function:

- SELECT regexp_replace('<i>Abhijeet</b>',
'<(\s)*/?(?i:script|i|b|u|embed|object|a|frameset|frame|iframe|meta|link|style|table|th|td|tr|tbody|input|select|option|form|map|area|!--)(.|\n)*?>',
'\&\s');
- cc SELECT regexp_replace('<i>Abhijeet</b>', '<
*/?(?i:script|i|b|u|embed|object|a|frameset|frame|iframe|meta|link|style|table|th|td|tr|tbody|input|select|option|form|map|area|!--)(.|\n)*?>',
'\& ' );

*Both these try giving me error as follows*:

- WARNING: nonstandard use of escape in a string literal at character
42
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
WARNING: nonstandard use of escape in a string literal at character
192
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
ERROR: invalid regular expression: quantifier operand invalid

can anyone suggest me why is that error ocurring?

----
Thanks & Regards,
Abhijeet G. Rathod
Software Engineer -(SCWCD)
Mail: abhijeetrathod262(at)gmail(dot)com
-----------------------------------------------------------
Dreamers of the day are dangerous men,
because they make their dreams happen.
-----------------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Waller, David 2007-11-14 14:05:57 Re: Insert statements really slow
Previous Message Alvaro Herrera 2007-11-14 11:48:03 Re: autovacuum and reindex