Re: What's wrong with this regexp?

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: What's wrong with this regexp?
Дата
Msg-id m33a5qc25h.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на What's wrong with this regexp?  (Nick <nboutelier@gmail.com>)
Список pgsql-general
Nick <nboutelier@gmail.com> wrote:

> SELECT TRUE WHERE '/steps/?step=10' ~ '^\/steps\/\?step=10$'

> Im guessing its an escape issue, but where am I going wrong?

You need to double-escape the question mark: Once for the
string literal, once for the regular expression (and you do
not need to escape the slashes). This gives:

| tim=# SELECT TRUE WHERE '/steps/?step=10' ~ E'^/steps/\\?step=10$';
|  bool
| ------
|  t
| (1 Zeile)

| tim=#

Tim

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

Предыдущее
От: Nick
Дата:
Сообщение: What's wrong with this regexp?
Следующее
От: merlyn@stonehenge.com (Randal L. Schwartz)
Дата:
Сообщение: Re: What's wrong with this regexp?