X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1B658D6F35 for ; Mon, 5 Sep 2005 12:12:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21219-08 for ; Mon, 5 Sep 2005 15:12:47 +0000 (GMT) Received: from mx1.surnet.cl (mx1.surnet.cl [216.155.73.180]) by svr1.postgresql.org (Postfix) with ESMTP id 07806D6F0D for ; Mon, 5 Sep 2005 12:12:45 -0300 (ADT) Received: from unknown (HELO cluster.surnet.cl) ([216.155.73.165]) by mx1.surnet.cl with ESMTP; 05 Sep 2005 11:13:45 -0400 X-IronPort-AV: i="3.96,169,1122868800"; d="scan'208"; a="4201753:sNHT47510830" Received: from alvh.no-ip.org (216.155.78.140) by cluster.surnet.cl (7.0.043) (authenticated as alvherre@surnet.cl) id 4317C634000505BB; Mon, 5 Sep 2005 11:12:44 -0400 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 9B6E4C2DC74; Mon, 5 Sep 2005 11:13:31 -0400 (CLT) Date: Mon, 5 Sep 2005 11:13:31 -0400 From: Alvaro Herrera To: Peter Eisentraut Cc: Aldor , pgsql-sql@postgresql.org Subject: Re: POSIX Regular Expression question Message-ID: <20050905151331.GA19192@surnet.cl> Mail-Followup-To: Peter Eisentraut , Aldor , pgsql-sql@postgresql.org References: <431C4EB2.80401@mediaroot.de> <200509051619.29210.peter_e@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200509051619.29210.peter_e@gmx.net> User-Agent: Mutt/1.5.10i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.301 required=5 tests=[AWL=-0.475, DNS_FROM_RFC_ABUSE=0.374, DNS_FROM_RFC_POST=1.376, RCVD_IN_NJABL_PROXY=1.026] X-Spam-Level: ** X-Archive-Number: 200509/35 X-Sequence-Number: 22582 On Mon, Sep 05, 2005 at 04:19:28PM +0200, Peter Eisentraut wrote: > Am Montag, 5. September 2005 15:57 schrieb Aldor: > > I want to get out a string only with characters A-Za-z. > > Any idea how to do this in Postgres with POSIX Regex? > > Presumably, > > colname ~ '^[A-Za-z]*$' > > If you want to be independent of locale issues, then you'd have to enumerate > all the letters instead of using a range specification. Note that [:alpha:] and such character classes are defined by POSIX to be locale independent: alvherre=# select 'á' ~ '[a-z]'; ?column? ---------- f (1 fila) alvherre=# select 'á' ~ '[[:alpha:]]'; ?column? ---------- t (1 fila) -- Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com "En las profundidades de nuestro inconsciente hay una obsesiva necesidad de un universo lógico y coherente. Pero el universo real se halla siempre un paso más allá de la lógica" (Irulan)