Re: Removing whitespace using regexp_replace

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Removing whitespace using regexp_replace
Дата
Msg-id fg26oe$dfg$1@ger.gmane.org
обсуждение исходный текст
Ответ на Re: Removing whitespace using regexp_replace  (Andreas Kretschmer <akretschmer@spamfence.net>)
Список pgsql-sql
Andreas Kretschmer wrote on 28.10.2007 13:32:
>> But it seems my problem was actually caused by something else:
>>
>> SELECT regexp_replace(myfield, '\s*', '', 'g')
>> FROM mytable;
> 
> you should escape the \, change to ...'\\s*'...
Ah! Didn't think this was necessary, as \t or \n did not need to be escaped.

> But without anchors this replaces all whitespaces, also within the text
> and not only at the beginning/end (^ and $)
Yes of course, this was only for testing ;)

Thanks for your help!

Thomas



В списке pgsql-sql по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Removing whitespace using regexp_replace
Следующее
От: Paul Lambert
Дата:
Сообщение: Select into with dynamic criteria in a plpgsql function