Re: [PATCHES] regexp_replace

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: [PATCHES] regexp_replace
Дата
Msg-id 52654.203.26.206.130.1118269932.squirrel@www.dunslane.net
обсуждение исходный текст
Ответ на Re: [PATCHES] regexp_replace  (Atsushi Ogawa <a_ogawa@hi-ho.ne.jp>)
Ответы Re: [PATCHES] regexp_replace  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Atsushi Ogawa said:
>
> How about changing the function name of each usage?
>
> regexp_replace:        replace first
> regexp_replace_all:    replace all
> regexp_ic_replace:     replace first and case insensitive
> regexp_ic_replace_all: replace all and case insensitive
>


That's just horrible. The number of function names will double with each
supported flag (e.g. I'd like to see extended regexes supported).

surely somthing like
 foo_replace (source text, pattern text, replacement text, flags text)
returns text

would fit the bill. OK, it reflects my Perl prejudices, but that looks more
natural to me. You could overload it so that the flags default to none
(which would be case sensitive, replace the first instance only, among other
things).

cheers

andrew




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

Предыдущее
От: "Matthew D. Fuller"
Дата:
Сообщение: Re: The Contrib Roundup (long)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: The Contrib Roundup (long)