Re: order of (escaped) characters in regex range

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: order of (escaped) characters in regex range
Дата
Msg-id CAHyXU0x-ku0L3L0mywjOmxddutubtzfdb1D+8KSzGwuVhnrp0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: order of (escaped) characters in regex range  (InterRob <rob.marjot@gmail.com>)
Ответы Re: order of (escaped) characters in regex range
Список pgsql-general
On Tue, Dec 13, 2011 at 7:51 AM, InterRob <rob.marjot@gmail.com> wrote:
> Thanks guys, i see what you mean.
>
> I do intend to use the PG escaping, in order to avoid that annoying
> warning... Hence, my expression should indeed be:
> SELECT regexp_matches('123-A' , E'(3[A-Z\\-\\(\\) ])');
>
> In the above expression i added the parentheses as I whish to match these as
> well :))

I advise dollar quoting when writing complicated regular expressions:

E'(3[A-Z\\-\\(\\) ])'
becomes
$$(3[A-Z\-\(\) ])$$

merlin

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

Предыдущее
От: "Sogard, Michael (DPS)"
Дата:
Сообщение: Re: Having Issue Getting the Postgresql Service to Start
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: order of (escaped) characters in regex range