Re: Regular expression character escape

Поиск
Список
Период
Сортировка
От Heiko Wundram
Тема Re: Regular expression character escape
Дата
Msg-id 4F47BE47.70909@modelnine.org
обсуждение исходный текст
Ответ на Re: Regular expression character escape  (Ronan Dunklau <rdunklau@gmail.com>)
Ответы Re: Regular expression character escape
Список pgsql-general
Am 24.02.2012 17:40, schrieb Ronan Dunklau:
> On 24/02/2012 17:09, Heiko Wundram wrote:
>> Use the corresponding function of your programming language/framework of
>> choice. E.g. Python delivers this as re.escape().
>
> Thank you, but as I wrote in the original post, I don't know how
> postgresql and python differ in their regexp syntax. Specifically, I
> know that re.escape escapes any non-alphanumeric character, including
> accented letters.
>
> If you have any evidence proving that everything will work fine with
> re.escape, I'll be more than happy to use it.

This will work (AFAICT, _and_ as far as I've used it): the regex-syntax
of Python is a superset of the regex-syntax of PostgreSQL (both are
based on PCRE, not on the library, but the syntax), and as such you'll
possibly do "too much" quoting, but never too little when simply using
the Python-builtin.

--
--- Heiko.

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

Предыдущее
От: Ronan Dunklau
Дата:
Сообщение: Re: Regular expression character escape
Следующее
От: Garrett Murphy
Дата:
Сообщение: Re: invalid memory alloc request size 1765277700 Error Question