Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.37.53]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with ESMTP id MAA05675 for <postgres-arch>; Thu, 6 Jul 1995 12:11:10 -0700
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.11/8.6.3) with SMTP id MAA02590; Thu, 6 Jul 1995 12:11:08 -0700
Message-Id: <199507061911.MAA02590@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
From: aoki@CS.Berkeley.EDU (Paul M. Aoki)
To: matthew@interaccess.com
Cc: postgres-arch@postgres.Berkeley.EDU
Subject: Re: trouble with "like" clause 
Reply-To: aoki@CS.Berkeley.EDU (Paul M. Aoki)
In-reply-to: Your message of Wed, 28 Jun 1995 09:54:39 -0500 (CDT) 
	     <199506281454.JAA14396@flowbee.interaccess.com> 
Date: Thu, 06 Jul 95 12:11:08 -0700
Sender: aoki@postgres.Berkeley.EDU
X-Mts: smtp

"matthew@risetime.com" <matthew@interaccess.com> writes:
> I want to be able to do a substring case-insensitive search on a
> text field.
> 
> So far I have:
> 	SELECT * from Movies WHERE MovieName ~ "[Bb][Aa][Tt]*"
> 
> Which will make macthes with "Batman Forever".  If I instead enter in
> "Forever" I should also make a matche, however, change the where clause to
> "*[Ff][Oo][Rr][Ee][Vv][Ee][Rr]" failes to find a match.

it's a c regular expression, not a shell pattern, so just
	"[Ff][Oo][Rr][Ee][Vv][Ee][Rr]"
should work.  that, or
	".*[Ff][Oo][Rr][Ee][Vv][Ee][Rr]"
--
  Paul M. Aoki          |  University of California at Berkeley
  aoki@CS.Berkeley.EDU  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776
