You have to use two backslashes, as the preprocessor will take the first
one out (I may be wrong about this, but I remember reading something
similar a few months ago on this list.) Also, remember that you have to
send two slashes to PostGres, which may mean that you need to use 4 slashes
in your code. IE, for a PERL program:
$dbi->prepare("SELECT field FROM table WHERE field ~* '\\+'");
is actually only sending:
SELECT field FROM table WHERE field ~* '\+'
to the backend, so you should use:
$dbi->prepare("SELECT field FROM table WHERE field ~* '\\\\+'");
At 03:04 PM 3/3/00, Gabriel Fernandez wrote:
>Hi,
>
>I'm using regular expressions in 6.5.3 version but i cannot find the
>character to escape special caracters as ?, $, ^.
>
>I've tried with \ but it doesn't works.
>
>Example: i want to find the row with the value 'fisica?' and i do:
>
>select title from libros where title ~* 'fisica\?' ;
>
>but i also obtain rows with values: 'fisicamente' or 'fisicas'
>
>What am i doing wrong ?
>
>Thanks in advance.
>
>Gabi :-)
>
>
>************
************