| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера