Thread: replace() and Regular Expressions
Is is possible to use replace along with regular expression to remove any and all punctuation from a field?
If so how?
I have tried: SELECT replace ('Brian\'s Co, INC.', 'Y*([.]',''),SUBSTRING('XY1234Z', 'Y*([0-9]{1,3})');
The second field substring works with out a problem the replace does not! How man I make that work?
am 31.10.2005, um 13:11:20 -0500 mailte DEV folgendes: > Is is possible to use replace along with regular expression to remove any > and all punctuation from a field? Which version? PG 8.1 have a function 'regex_replace'. HTH, Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe ===
Currently I am running 8.0.1. Looks like an upgrade is in my future. Oh Joy!!!! LOL Thank you! -----Original Message----- From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of A. Kretschmer Sent: Monday, October 31, 2005 1:43 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] replace() and Regular Expressions Importance: High am 31.10.2005, um 13:11:20 -0500 mailte DEV folgendes: > Is is possible to use replace along with regular expression to remove any > and all punctuation from a field? Which version? PG 8.1 have a function 'regex_replace'. HTH, Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe === ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster
am 01.11.2005, um 13:01:54 -0500 mailte DEV folgendes: > Currently I am running 8.0.1. Looks like an upgrade is in my future. Oh > Joy!!!! LOL > > am 31.10.2005, um 13:11:20 -0500 mailte DEV folgendes: > > Is is possible to use replace along with regular expression to remove any > > and all punctuation from a field? > > Which version? > > PG 8.1 have a function 'regex_replace'. Other solution: use plpgperl to use regex-functions. Btw.: http://www.vranx.de/mail/tofu.html HTH, Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe ===