X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9E2D4D1B510 for ; Thu, 23 Oct 2003 18:42:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 06740-08 for ; Thu, 23 Oct 2003 15:42:15 -0300 (ADT) Received: from conexa.fciencias.unam.mx (conexa.fciencias.unam.mx [132.248.109.170]) by svr1.postgresql.org (Postfix) with ESMTP id D51EED1B53C for ; Thu, 23 Oct 2003 15:42:08 -0300 (ADT) Received: from conexa.fciencias.unam.mx (conexa.fciencias.unam.mx [127.0.0.1]) by conexa.fciencias.unam.mx (8.12.8/8.12.8) with ESMTP id h9NJiwmB030477; Thu, 23 Oct 2003 13:44:58 -0600 Received: (from masm@localhost) by conexa.fciencias.unam.mx (8.12.8/8.12.8/Submit) id h9NJiwuu030475; Thu, 23 Oct 2003 13:44:58 -0600 X-Authentication-Warning: conexa.fciencias.unam.mx: masm set sender to masm@fciencias.unam.mx using -f To: Matias Surdi Cc: pgsql-sql@postgresql.org Subject: Re: Regular expression problem References: <3F981A06.5070009@interlap.com.ar> In-Reply-To: <3F981A06.5070009@interlap.com.ar> From: Manuel Sugawara User-Name: Manuel Sugawara User-Mail-Address: masm@fciencias.unam.mx Date: 23 Oct 2003 13:44:58 -0600 Message-ID: Lines: 18 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Portable Code) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/311 X-Sequence-Number: 15711 Matias Surdi writes: > 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" Use something like '^[a-z]{2}$' Regards, Manuel.