Re: Funtion to clean up strings?

From: "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>
To: Andreas <maps(dot)on(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Funtion to clean up strings?
Date: 2009-02-13 00:00:46
Message-ID: ae46fee10902121600v2b70d083m7c68e9421edbad56@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

2009/2/12 Andreas <maps(dot)on(at)gmx(dot)net>:
> Hi,
>
> I need a function that removes characters in strings that aren't in a given
> set of chars.
> e.g
> Input: 12-34/ 56(8)
> I want just numbers so Output should in this case be: 1234568
>
> Is there a solution?

One is:

SELECT regexp_replace('12-34/ 56(8)',E'[^0-9]','','g');

--
Dickson S. Guedes
-
mail/xmpp: guedes(at)guedesoft(dot)net - skype: guediz
http://guedesoft.net - http://planeta.postgresql.org.br

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas 2009-02-13 00:15:54 Re: Funtion to clean up strings?
Previous Message Andreas 2009-02-12 23:20:54 Funtion to clean up strings?