RE: [GENERAL] Another Regular Expression "Problem"

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: Charles Curley <charles(dot)h(dot)curley(at)lmco(dot)com>, PostgreSQL Mailing List <pgsql-general(at)postgreSQL(dot)org>
Subject: RE: [GENERAL] Another Regular Expression "Problem"
Date: 1998-10-15 20:29:58
Message-ID: F10BB1FAF801D111829B0060971D839F47938D@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Original Message-----
> From: Charles Curley [SMTP:charles(dot)h(dot)curley(at)lmco(dot)com]
> Sent: Thursday, October 15, 1998 2:52 PM
> To: PostgreSQL Mailing List
> Subject: [GENERAL] Another Regular Expression "Problem"
>
> Hopefully I'm not being dense again ...
> I've got a CGI frontend that I'd like to give users the ability to
> type in regular expressions into forms and do queries based up this
> data. During testing things work fine as long as I keep with simple
> expressions like:
>    select "first", "last" from "employees" where "first" ~ '^Charles'
> But if I do something like the following, I get nothing:
>    select "first", "last" from "employees" where "first" ~
> '^(Charles)|(James)'
> I looked down in src/backend/regex at re_format.7 and this is
> explained in that document as "extended" RE's. I've tried this RE with
> egrep and it matches lines like I want (pretty simple stuff here).
> What gives?
> try:
SELECT "first", "last"
FROM "employees"
WHERE "first" ~ '^Charles|^James';

Browse pgsql-general by date

  From Date Subject
Next Message Jackson, DeJuan 1998-10-15 20:46:45 RE: [GENERAL] Easiest and shortest way?
Previous Message Charles Curley 1998-10-15 19:52:11 [GENERAL] Another Regular Expression "Problem"