Re: [GENERAL] Case insensitive "contains" search

From: "Gene Selkov Jr(dot)" <selkovjr(at)mcs(dot)anl(dot)gov>
To: Charles Curley <charles(dot)h(dot)curley(at)lmco(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Case insensitive "contains" search
Date: 1998-11-10 04:18:14
Message-ID: 199811100417.WAA22471@antares.mcs.anl.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Charles Curley wrote:
>
> Ulf Mehlig wrote:
>
> > In my opinion, the regexps are much more powerfull compared to "like
> > '%anything'"-statements; but the regular expression syntax is a little
> > bit weird, and if you have a look in the docs of programs which
> > heavily depend on regexps (perl, grep, emacs, ...) you'll find some
> > nice annoying little differences in "to-quote-or-not-to-quote"
> > sections ...
>
> Is there a text that describes the RE usage in PostgrSQL? I'd like to know
> how to do more complicated expressions,

Things look like POSIX expressions to me. Also looks like the manuals
for regexp were not included because postgres simply links to the regex
library documented elswhere. Try these two sources:

http://tiger8.com/us/regexp-manpage.html (complete but too formal)
http://www.blighty.com/products/spade/help/d_regex.htm (informal but incomplete)

> like, "^(((charl|jam)es)|(bob))",
> which should match a field that begins with "charles", "james", or "bob".

try (((^charl|^jam)es)|(^bob))

--Gene

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Meyer 1998-11-10 04:55:18 Python interface and large objects?
Previous Message Bruce Momjian 1998-11-09 20:57:09 Re: [GENERAL] Incrementing a Serial Field