Search Postgresql Archives

POSIX Escape

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux