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