Regular expression problem

From: Matias Surdi <matiass(at)interlap(dot)com(dot)ar>
To: pgsql-sql(at)postgresql(dot)org
Subject: Regular expression problem
Date: 2003-10-23 18:12:22
Message-ID: 3F981A06.5070009@interlap.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi... I'm dealing with a regular expression in a check constraint for
many days.... i'm stuck with this...
what I'm doing is adding a check to an existing table on a field called
codigoex1 (varchar(9) )
check (codigoex1 ~* '[a-z]{2,2}')

and I can't get it to work!
I want to validate only input data such as "ar" "Us" "bR" and NOT
something like "rum" "a"
the previous reg. expr. only works like it were ~* '[a-z]{2}' , so, it
ignores the maximum length.

Tanks a lot!

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message yusuf0478 2003-10-23 18:17:08 Query Help using Except
Previous Message Richard Huxton 2003-10-23 15:35:43 Re: Réf. : Re: [SQL] Left outer join