Re: Funtion to clean up strings?

Поиск
Список
Период
Сортировка
От Dickson S. Guedes
Тема Re: Funtion to clean up strings?
Дата
Msg-id ae46fee10902121600v2b70d083m7c68e9421edbad56@mail.gmail.com
обсуждение исходный текст
Ответ на Funtion to clean up strings?  (Andreas <maps.on@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Andreas
Дата:
Сообщение: Funtion to clean up strings?
Следующее
От: Andreas
Дата:
Сообщение: Re: Funtion to clean up strings?