Re: [SQL] Escaping w/i regular expressions - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: [SQL] Escaping w/i regular expressions
Date
Msg-id 199907080218.WAA22723@candle.pha.pa.us
Whole thread Raw
In response to Escaping w/i regular expressions  (Peter Eisentraut <peter@pathwaynet.com>)
List pgsql-sql
> How do you escape a ' (apostrophe) within a regular expression, so it does
> not close off the string? Something like
>    ... ~ '[0-9.,\']'
> does not seem to work.
> (Pgsql 6.4.2)
> 

Seems to work in 6.5:
test=> select * from test where x ~ '[acb\']';x-'(1 row)


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-sql by date:

Previous
From: Chris Bitmead
Date:
Subject: Re: [SQL] Tips and tricks
Next
From: Bruce Momjian
Date:
Subject: Re: [SQL] Index on Type Numeric