From: Peter Eisentraut <peter_e@gmx.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: brianb-pgsql@edsamail.com, pgsql-sql@postgresql.org, Bruce Momjian <pgman@candle.pha.pa.us>
Subject: Re: Search for underscore w/ LIKE
Date: Sat, 8 Jul 2000 02:09:12 +0200 (CEST)
Message-ID: <Pine.LNX.4.21.0007072221180.587-100000@localhost.localdomain> (raw)
In-Reply-To: <11200.962994098@sss.pgh.pa.us>
Tom Lane writes:
> Exercise for the student: if you need to match a literal backslash
> in a LIKE pattern, how many backslashes do you have to write in your
> query?
I like how Python handles this: You prefix the text literal with an `r'
(as in "raw") and the backslashes are not special. Maybe we could offer
that as well.
blah ~ r'.+\..+'
--
Peter Eisentraut Sernanders väg 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: peter_e@gmx.net, tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us
Subject: Re: Search for underscore w/ LIKE
In-Reply-To: <Pine.LNX.4.21.0007072221180.587-100000@localhost.localdomain>
References: <11200.962994098@sss.pgh.pa.us> <Pine.LNX.4.21.0007072221180.587-100000@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox