Skip site navigation (1) Skip section navigation (2)

Re: Re: [GENERAL] Regular expressions syntax: is \ the escape character ?

From: Gabriel Fernandez <gabi(at)unica(dot)edu>
To: PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: Re: [GENERAL] Regular expressions syntax: is \ the escape character ?
Date: 2000-03-07 10:03:43
Message-ID: 38C4D3FF.DDCADCD@unica.edu (view raw or flat)
Thread:
Lists: pgsql-general
Thanks a million to you all. Finally, as someone in the list suggested, i'm
using the double backslash (\\) and it seems it works ok.

The only problem i have is when i want to escape a single quote (') or the
backslash (\).

For example: i have one row with the value 'ONE\SECOND'

I try to recover it doing (from psql frontend):

select field1 from table1 where field1 ~* 'ONE\\\'  ;

But it doesn't work, and the parser seems to be confused (it asks me to
close again the quote ' ).

The problem is the same with the single quote '. I've tried this:

select field1 from table1 where field1 ~* 'D\\'ALEMA' ;

But it doesn't work neither.

Thanks for your help.

Gabi :-)



In response to

Responses

pgsql-general by date

Next:From: Oliver ElphickDate: 2000-03-07 10:12:07
Subject: Re: [GENERAL] FOREIGN KEY syntax
Previous:From: HowieDate: 2000-03-07 08:39:19
Subject: Re: [GENERAL] 50 MB Table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group