Re: BUG #10334: Function regexp_split_to_array Error with '.' (comma)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #10334: Function regexp_split_to_array Error with '.' (comma)
Дата
Msg-id 16205.1400261118@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #10334: Function regexp_split_to_array Error with '.' (comma)  (danilogarciamartins@hotmail.com)
Список pgsql-bugs
danilogarciamartins@hotmail.com writes:
> Ex.: select regexp_split_to_array('1.2.3','.')
> returns {"","","","","",""} and not
> {1,2,3}.

This is not a bug: "." is a wild-card character in regular expressions.
You could get the behavior you're evidently after by escaping it:

# select regexp_split_to_array('1.2.3','\.');
 regexp_split_to_array
-----------------------
 {1,2,3}
(1 row)


            regards, tom lane

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

Предыдущее
От: danilogarciamartins@hotmail.com
Дата:
Сообщение: BUG #10334: Function regexp_split_to_array Error with '.' (comma)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #10338: could not read block