pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedReplace string
4+ messages / 3 participants
[nested] [flat]
* Replace string
@ 2007-04-10 20:40 PostgreSQL Admin <postgres@productivitymedia.com>
0 siblings, 2 replies; 4+ messages in thread
From: PostgreSQL Admin @ 2007-04-10 20:40 UTC (permalink / raw)
To: pgsql-sql
Hi,
I want to replace a title with dashes and also remove punctuation.
e.g, The blue fox's fur. -> The-blue-fox-fur
Thanks for any input,
J
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Replace string
@ 2007-04-12 05:12 A. Kretschmer <andreas.kretschmer@schollglas.com>
parent: PostgreSQL Admin <postgres@productivitymedia.com>
1 sibling, 1 reply; 4+ messages in thread
From: A. Kretschmer @ 2007-04-12 05:12 UTC (permalink / raw)
To: pgsql-sql
am Tue, dem 10.04.2007, um 16:40:41 -0400 mailte PostgreSQL Admin folgendes:
> Hi,
>
> I want to replace a title with dashes and also remove punctuation.
>
> e.g, The blue fox's fur. -> The-blue-fox-fur
test=*# select regexp_replace(regexp_replace('The blue fox\'s fur.', ' ', '-', 'g'), '\\.', '');
regexp_replace
--------------------
The-blue-fox's-fur
(1 row)
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Replace string
@ 2007-04-12 05:29 Rodrigo De León <rdeleonp@gmail.com>
parent: PostgreSQL Admin <postgres@productivitymedia.com>
1 sibling, 0 replies; 4+ messages in thread
From: Rodrigo De León @ 2007-04-12 05:29 UTC (permalink / raw)
To: pgsql-sql; +Cc: PostgreSQL Admin <postgres@productivitymedia.com>
On 4/10/07, PostgreSQL Admin <postgres@productivitymedia.com> wrote:
> Hi,
>
> I want to replace a title with dashes and also remove punctuation.
>
> e.g, The blue fox's fur. -> The-blue-fox-fur
>
>
> Thanks for any input,
> J
SELECT translate('The blue fox''s fur.', ' .''', '-')
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Replace string
@ 2007-04-12 19:51 PostgreSQL Admin <postgres@productivitymedia.com>
parent: A. Kretschmer <andreas.kretschmer@schollglas.com>
0 siblings, 0 replies; 4+ messages in thread
From: PostgreSQL Admin @ 2007-04-12 19:51 UTC (permalink / raw)
To: A. Kretschmer <andreas.kretschmer@schollglas.com>; +Cc: pgsql-sql@postgresql.org, Rodrigo De León <rdeleonp@gmail.com>
> 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:]]', ''), ' ', '-');
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2007-04-12 19:51 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-10 20:40 Replace string PostgreSQL Admin <postgres@productivitymedia.com>
2007-04-12 05:12 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
2007-04-12 19:51 ` PostgreSQL Admin <postgres@productivitymedia.com>
2007-04-12 05:29 ` Rodrigo De León <rdeleonp@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox