Re: Escaping parenthesis in regular expressions....

Поиск
Список
Период
Сортировка
От Charles Tassell
Тема Re: Escaping parenthesis in regular expressions....
Дата
Msg-id 4.3.2.7.2.20000714155348.00acd540@mailer.isn.net
обсуждение исходный текст
Ответ на Escaping parenthesis in regular expressions....  ("Steve Wolfe" <steve@iboats.com>)
Список pgsql-general
You were close, you need two backslashes.  IE, '401\\(k\\)'  The reasoning
for this is that the first slash is taken off by the preprocessor, and then
it goes through another processor for the regular expression
matching.  BTW: If you ever want to doa  search for a slash itself, you
need 4 slashes, ie: 'This \\\\ way'


At 03:00 PM 7/14/00, Steve Wolfe wrote:

>   How does one escape parenthesis in a regular expression in Postgres?
>
>   An example is:
>
>select * from subcategories where subcategory ~* '401(k)';
>
>Which does not work.  I've tried:
>
>select * from subcategories where subcategory ~* '401\(k\)';
>
>That still didn't work.  Any advice would be much appreciated.  BTW,
>
>select * from subcategories where subcategory  =  '401(k)';
>
>does work. ; )
>
>steve


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

Предыдущее
От: Yves Dorfsman
Дата:
Сообщение: Re: Postgresql and Postmaster response
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Escaping parenthesis in regular expressions....