Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 311EF1337B39 for ; Wed, 19 Jan 2011 10:18:48 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 25168-05 for ; Wed, 19 Jan 2011 14:18:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mh7.mail.rice.edu (mh7.mail.rice.edu [128.42.199.46]) by mail.postgresql.org (Postfix) with ESMTP id BDA5C13364DE for ; Wed, 19 Jan 2011 10:18:40 -0400 (AST) Received: from mh7.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh7.mail.rice.edu (Postfix) with ESMTP id B7A5728F946; Wed, 19 Jan 2011 08:18:40 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh7.mail.rice.edu, auth channel Received: from mh7.mail.rice.edu ([127.0.0.1]) by mh7.mail.rice.edu (mh7.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 59xzWOKBpqnF; Wed, 19 Jan 2011 08:18:40 -0600 (CST) X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.is.rice.edu (aart.is.rice.edu [168.7.56.48]) by mh7.mail.rice.edu (Postfix) with ESMTP id 857F428F945; Wed, 19 Jan 2011 08:18:40 -0600 (CST) Received: by aart.is.rice.edu (Postfix, from userid 18612) id 6C6DA2D5A6; Wed, 19 Jan 2011 08:18:39 -0600 (CST) Date: Wed, 19 Jan 2011 08:18:38 -0600 From: Kenneth Marshall To: Stephen Belcher Cc: Samuel Gendler , andrew1 , pgsql-sql@postgresql.org Subject: Re: question about reg. expression Message-ID: <20110119141838.GJ6475@aart.is.rice.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/53 X-Sequence-Number: 35000 On Wed, Jan 19, 2011 at 08:17:50AM -0500, Stephen Belcher wrote: > Another way to match multiple occurrences is to use curly brackets with a > number, like: > select 'ab' ~ '^[a-z]{2}$'; > > It can be done with a range of numbers as well: > select 'ab' ~ '^[a-z]{2,4}$'; > select 'abab' ~ '^[a-z]{2,4}$'; > > I believe, however, that the curly brackets notation was introduced in 9.0 > and is not available in earlier versions. > > --Stephen > That is not so. POSIX regular expressions, including the curly backet notation, are available in all current supported releases of PostgreSQL: http://www.postgresql.org/docs/8.2/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP I did not bother to check our local documentation for earlier releases as to how much earlier such support was available. Cheers, Ken