[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] How to remove a set of characters in text-columns ?
From:       Steve Crawford <scrawford () pinpointresearch ! com>
Date:       2011-06-30 19:49:20
Message-ID: 4E0CD340.30809 () pinpointresearch ! com
[Download RAW message or body]

On 06/30/2011 12:28 PM, Andreas wrote:
> Hi,
> how can I remove a set of characters in text-columns ?
> Say I'd like to remove { } ( ) ' " , ; . : !
> Of course I can chain replace ( replace ( replace ( replace ( ... , '' 
> ) .... and replace the chars one by one against an empty string ''.
>
> There might be a more elegant way.
> Is there ?
>
>
> regards
>
Look at regexp_replace()
http://www.postgresql.org/docs/9.0/static/functions-string.html
http://www.postgresql.org/docs/9.0/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP

Cheers,
Steve


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic