Re: order of (escaped) characters in regex range

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: order of (escaped) characters in regex range
Дата
Msg-id 20111213141435.GA10626@depesz.com
обсуждение исходный текст
Ответ на Re: order of (escaped) characters in regex range  (InterRob <rob.marjot@gmail.com>)
Список pgsql-general
On Tue, Dec 13, 2011 at 02:51:15PM +0100, InterRob 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 :))

instead of putting that much quoting just do:
SELECT regexp_matches('123-A' , '(3[A-Z() -])');
 ( and ) don't need to be quoted, and if you'll move - at the beginning
 or end (i prefer end) of range, it doesn't need to be quoted either.

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

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

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