Re: Funtion to clean up strings? - Mailing list pgsql-sql

From Dickson S. Guedes
Subject Re: Funtion to clean up strings?
Date
Msg-id ae46fee10902121600v2b70d083m7c68e9421edbad56@mail.gmail.com
Whole thread Raw
In response to Funtion to clean up strings?  (Andreas <maps.on@gmx.net>)
List pgsql-sql
2009/2/12 Andreas <maps.on@gmx.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@guedesoft.net - skype: guediz
http://guedesoft.net - http://planeta.postgresql.org.br


pgsql-sql by date:

Previous
From: Andreas
Date:
Subject: Funtion to clean up strings?
Next
From: Andreas
Date:
Subject: Re: Funtion to clean up strings?