POSIX Escape

Поиск
Список
Период
Сортировка
От Howard Cole
Тема POSIX Escape
Дата
Msg-id 48629C3D.8040409@selestial.com
обсуждение исходный текст
Список pgsql-general
Hello All,

Apologies if this is a bit off-topic. Any hints as to what character
sequences need escaping in Postgres's regular expressions?

Let me show you the problem.

If I want to find all strings that start with 'postgres' I use the regex

select str ~ '^postgres'.

However if str contains reserved meta characters, e.g. +(-)[.]{} etc
then I need to escape that sequence somehow? e.g. to find a string
starting 'fish + chips' I need to escape for regex and then postgres.

select str ~ '^fish\\s\\+\\schips''

Has anyone got a definitive list of replacements that are required for
Postgres's version of Regular Expressions?

Howard.



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

Предыдущее
От: Andrew
Дата:
Сообщение: Re: 0xc3 error Text Search Windows French
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: 0xc3 error Text Search Windows French