Re: Replace string

From: PostgreSQL Admin <postgres(at)productivitymedia(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, Rodrigo De León <rdeleonp(at)gmail(dot)com>
Subject: Re: Replace string
Date: 2007-04-12 19:51:07
Message-ID: 461E8DAB.6090504@productivitymedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


> test=*# select regexp_replace(regexp_replace('The blue fox\'s fur.', ' ', '-', 'g'), '\\.', '');
> regexp_replace
> --------------------
> The-blue-fox's-fur
> (1 row)
>
>
> Andreas
>
Thanks for the input.

I came up with this:

REPLACE(regexp_replace('The blue fox\'s fur', '[[:punct:]]', ''), ' ', '-');

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Karthikeyan Sundaram 2007-04-12 22:44:19 question on plpgsql block
Previous Message T E Schmitz 2007-04-12 18:32:10 replace EXCEPT by JOIN