| От | Joe Conway |
|---|---|
| Тема | Re: Backslash Bug in ARE Class-Shorthand Escape? |
| Дата | |
| Msg-id | 3FD19020.6020407@joeconway.com обсуждение исходный текст |
| Ответ на | Backslash Bug in ARE Class-Shorthand Escape? (david@fetter.org (David Fetter)) |
| Ответы |
Re: Backslash Bug in ARE Class-Shorthand Escape?
|
| Список | pgsql-bugs |
David Fetter wrote: > I have a little puzzlement. In the first select, I double the > backslash and return true. In the second, I don't and get false. > Have I missed something important in the docs? I don't know if it is clear in the docs anywhere wrt regex, but the string literal parser will consume one layer of backslashes on you. So in your first case '\\d' is fed into the regex matching function as '\d' (string literal parser sees \\ == escape \ == \), and in the second case '\d' is fed in as 'd' (string literal parser sees \d == escape d == d). The basic rule at work here is you need to double up all backslashes. HTH, Joe
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера