From: Kenneth Marshall <ktm@rice.edu>
To: Stephen Belcher <sycobuny@malkier.net>
Cc: Samuel Gendler <sgendler@ideasculptor.com>
Cc: andrew1 <andrew1@mytrashmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: question about reg. expression
Date: Wed, 19 Jan 2011 08:18:38 -0600
Message-ID: <20110119141838.GJ6475@aart.is.rice.edu> (raw)
In-Reply-To: <AANLkTim9UYesBGU6fKf-sP6hcka8i45CyskKee9RPViJ@mail.gmail.com>
References: <ih58f7$63u$1@speranza.aioe.org>
<AANLkTi=guS5T46M5wt7VXH8_0SfZ-_D+uG6Y=68FAFWJ@mail.gmail.com>
<AANLkTim9UYesBGU6fKf-sP6hcka8i45CyskKee9RPViJ@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ktm@rice.edu, sycobuny@malkier.net, sgendler@ideasculptor.com, andrew1@mytrashmail.com
Subject: Re: question about reg. expression
In-Reply-To: <20110119141838.GJ6475@aart.is.rice.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox