From: rdear <rdear@dev.internal>
To: pgsql-sql@postgresql.org
Subject: Re: PL/PGSQL Regexe
Date: Thu, 20 Sep 2001 10:45:30 +0100
Message-ID: <3BA9BABA.5030407@dev.internal> (raw)
References: <28279.1000909202@sss.pgh.pa.us>
Humm... 7.0.2, I'll upgrade and try again.
Thanks!
Tom Lane wrote:
> rdear <rdear@dev.internal> writes:
>
>> I'm doing a check within a PL/PGSQL function using a regular expression
>> and I get the error:
>
>> ERROR: regcomp failed with error invalid character range
>
>> This appears to be because of the underscore "_" character. The regex I
>> want to use is ''[A-Za-z0-9_]'' but this doesn't work.
>
>
> Seems to work for me:
>
> regression=# select 'a' ~ '[A-Za-z0-9_]';
> ?column?
> ----------
> t
> (1 row)
>
> regression=# select '_' ~ '[A-Za-z0-9_]';
> ?column?
> ----------
> t
> (1 row)
>
> regression=# select ':' ~ '[A-Za-z0-9_]';
> ?column?
> ----------
> f
> (1 row)
>
> How old is your Postgres? (I can tell by the spelling of the error
> message that it's not current.)
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
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: rdear@dev.internal
Subject: Re: PL/PGSQL Regexe
In-Reply-To: <3BA9BABA.5030407@dev.internal>
* 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