Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.org (8.10.1/8.10.1) with ESMTP id e6803YW42886 for ; Fri, 7 Jul 2000 20:03:34 -0400 (EDT) Received: from regulus.student.UU.SE ([130.238.5.2]:65126 "EHLO regulus.its.uu.se") by merganser.its.uu.se with ESMTP id ; Sat, 8 Jul 2000 02:03:14 +0200 Received: from peter (helo=localhost) by regulus.its.uu.se with local-esmtp (Exim 3.02 #2) id 13AiBE-0006B7-00; Sat, 08 Jul 2000 02:09:12 +0200 Date: Sat, 8 Jul 2000 02:09:12 +0200 (CEST) From: Peter Eisentraut To: Tom Lane cc: brianb-pgsql@edsamail.com, pgsql-sql@postgresql.org, Bruce Momjian Subject: Re: Search for underscore w/ LIKE In-Reply-To: <11200.962994098@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-Archive-Number: 200007/88 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