Re: [GENERAL] Regular expressions syntax: is \ the escape character ?
В списке pgsql-general по дате отправления:
| От | Chris Jones |
|---|---|
| Тема | Re: [GENERAL] Regular expressions syntax: is \ the escape character ? |
| Дата | |
| Msg-id | x64saioizd.fsf@reddwarf.rightnowtech.com обсуждение исходный текст |
| Ответ на | Regular expressions syntax: is \ the escape character ? (Gabriel Fernandez <gabi@unica.edu>) |
| Список | pgsql-general |
Gabriel Fernandez <gabi@unica.edu> writes:
> The only problem i have is when i want to escape a single quote (') or the
> backslash (\).
>
> For example: i have one row with the value 'ONE\SECOND'
>
> I try to recover it doing (from psql frontend):
>
> select field1 from table1 where field1 ~* 'ONE\\\' ;
Heh. This will probably work if you use *four* backslashes. The
first time it gets parsed, 'ONE\\\\' -> 'ONE\\', because each '\\'
sequence will reduce to a single '\'. Then the second time it gets
parsed, the '\\' -> '\', which is what you want.
(Haven't tested it, but I've seen similar things in other places.)
Chris
--
---------------------------------------------------- cjones@rightnowtech.com
Chris Jones
System Administrator, Right Now Technologies, Inc.
"Is this going to be a stand-up programming session, sir, or another bug hunt?"
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера