Re: [GENERAL] Case insensitive "contains" search - Mailing list pgsql-general

From Gene Selkov Jr.
Subject Re: [GENERAL] Case insensitive "contains" search
Date
Msg-id 199811100417.WAA22471@antares.mcs.anl.gov
Whole thread Raw
In response to Re: [GENERAL] Case insensitive "contains" search  (Charles Curley <charles.h.curley@lmco.com>)
Responses Python interface and large objects?  (Mike Meyer <mwm@phone.net>)
List 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

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Incrementing a Serial Field
Next
From: Mike Meyer
Date:
Subject: Python interface and large objects?