Extending Regular Expression bounds limit of 255.
Extending Regular Expression bounds limit of 255.
От:
Brent DeSpain <bd.postgres@gmail.com>
Дата:
In the docs http://www.postgresql.org/docs/8.3/interactive/functions-matching.html#POSIX-EMBEDDED-OPTIONS-TABLE
it says that Regular Expression bounds {m,n} that m and n can be 0-255. Is there a way to extend the upper limit. We are trying to be consistent between Regular Expressionimplementation an the other implementations do not have this limit.
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.
Re: Extending Regular Expression bounds limit of 255.
От:
Andrej <andrej.groups@gmail.com>
Дата:
On 28 May 2010 07:33, Brent DeSpain wrote:
> In the docs
> http://www.postgresql.org/docs/8.3/interactive/functions-matching.html#POSIX-EMBEDDED-OPTIONS-TABLE
> it says that Regular Expression bounds {m,n} that m and n can be 0-255. Is
> there a way to extend the upper limit. We are trying to be consistent
> between Regular Expressionimplementation an the other implementations do not
> have this limit.
Interesting. The POSIX standard for REs dictates this limit; which
implementations
you're using don't adhere to it?
Cheers,
Andrej
--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.
http://www.american.edu/econ/notes/htmlmail.htm
Re: Extending Regular Expression bounds limit of 255.
От:
Brent DeSpain <bd.postgres@gmail.com>
Дата:
No. Strangely enough they don't in enforce this limit.
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.
On Thu, May 27, 2010 at 2:59 PM, Andrej <andrej.groups@gmail.com> wrote:
On 28 May 2010 07:33, Brent DeSpain <bd.postgres@gmail.com> wrote:Interesting. The POSIX standard for REs dictates this limit; which
> In the docs
> http://www.postgresql.org/docs/8.3/interactive/functions-matching.html#POSIX-EMBEDDED-OPTIONS-TABLE
> it says that Regular Expression bounds {m,n} that m and n can be 0-255. Is
> there a way to extend the upper limit. We are trying to be consistent
> between Regular Expressionimplementation an the other implementations do not
> have this limit.
implementations
you're using don't adhere to it?
Cheers,
Andrej
--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.
http://www.american.edu/econ/notes/htmlmail.htm
Re: Extending Regular Expression bounds limit of 255.
От:
Brent DeSpain <bd.postgres@gmail.com>
Дата:
It looks like most of our tools are using the Perl version of regular expressions with an upper limit of a bound being 32766. Is there any way to change this in PG? Or can I change from POSIX to Perl?
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.
On Thu, May 27, 2010 at 4:44 PM, Brent DeSpain <bd.postgres@gmail.com> wrote:
No. Strangely enough they don't in enforce this limit.
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.On Thu, May 27, 2010 at 2:59 PM, Andrej <andrej.groups@gmail.com> wrote:On 28 May 2010 07:33, Brent DeSpain <bd.postgres@gmail.com> wrote:Interesting. The POSIX standard for REs dictates this limit; which
> In the docs
> http://www.postgresql.org/docs/8.3/interactive/functions-matching.html#POSIX-EMBEDDED-OPTIONS-TABLE
> it says that Regular Expression bounds {m,n} that m and n can be 0-255. Is
> there a way to extend the upper limit. We are trying to be consistent
> between Regular Expressionimplementation an the other implementations do not
> have this limit.
implementations
you're using don't adhere to it?
Cheers,
Andrej
--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.
http://www.american.edu/econ/notes/htmlmail.htm
Re: Extending Regular Expression bounds limit of 255.
От:
alvherre <alvherre@commandprompt.com>
Дата:
Excerpts from Brent DeSpain's message of jue may 27 18:55:55 -0400 2010: > It looks like most of our tools are using the Perl version of regular > expressions with an upper limit of a bound being 32766. Is there any way to > change this in PG? Or can I change from POSIX to Perl? See regcomp.c; you'll have to recompile. The interesting constant is DUPMAX (defined in regguts.h as per POSIX), but note that there's arithmetic in repeat() with those values. I wouldn't recommend doing any of this unless you have time to figure out whether the algorithms are efficient for larger values though. -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Re: Extending Regular Expression bounds limit of 255.
От:
Brent DeSpain <bd.postgres@gmail.com>
Дата:
Yep. That is what I was looking at this morning. It is probably too late in this release of our project to make this change.
Thanks for the help.
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.
Thanks for the help.
Brent DeSpain
Schweitzer Engineering Laboratories, Inc.
On Fri, May 28, 2010 at 9:14 AM, alvherre <alvherre@commandprompt.com> wrote:
Excerpts from Brent DeSpain's message of jue may 27 18:55:55 -0400 2010:> It looks like most of our tools are using the Perl version of regularSee regcomp.c; you'll have to recompile. The interesting constant is
> expressions with an upper limit of a bound being 32766. Is there any way to
> change this in PG? Or can I change from POSIX to Perl?
DUPMAX (defined in regguts.h as per POSIX), but note that there's
arithmetic in repeat() with those values. I wouldn't recommend doing
any of this unless you have time to figure out whether the algorithms
are efficient for larger values though.
--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Re: Extending Regular Expression bounds limit of 255.
От:
Jasen Betts <jasen@xnet.co.nz>
Дата:
On 2010-05-27, Brent DeSpain wrote: > --00504502c13812967604879b4ba3 > Content-Type: text/plain; charset=ISO-8859-1 > > It looks like most of our tools are using the Perl version of regular > expressions with an upper limit of a bound being 32766. Is there any way to > change this in PG? Or can I change from POSIX to Perl? perhaps you can do something in pl-perl? posix regular expressions are different to perl regular expressions in several ways.
Re: Extending Regular Expression bounds limit of 255.
От:
Tim Landscheidt <tim@tim-landscheidt.de>
Дата:
Jasen Betts wrote:
>> It looks like most of our tools are using the Perl version of regular
>> expressions with an upper limit of a bound being 32766. Is there any way to
>> change this in PG? Or can I change from POSIX to Perl?
> perhaps you can do something in pl-perl?
> posix regular expressions are different to perl regular expressions in
> several ways.
Another last resort possibility would of course be to "pre-
compile" the regular expressions from "A{2000}" to
"A{255}A{255}A{255}A{255}A{255}A{255}A{255}A{215}" (with the
headaches of "A{1000,2000}" left as an exercise to the read-
er :-)).
Tim
Re: Extending Regular Expression bounds limit of 255.
От:
Jasen Betts <jasen@xnet.co.nz>
Дата:
On 2010-05-29, Tim Landscheidt wrote:
> Jasen Betts wrote:
>
>>> It looks like most of our tools are using the Perl version of regular
>>> expressions with an upper limit of a bound being 32766. Is there any way to
>>> change this in PG? Or can I change from POSIX to Perl?
>
>> perhaps you can do something in pl-perl?
>
>> posix regular expressions are different to perl regular expressions in
>> several ways.
>
> Another last resort possibility would of course be to "pre-
> compile" the regular expressions from "A{2000}" to
> "A{255}A{255}A{255}A{255}A{255}A{255}A{255}A{215}"
(A{200}){10}might work better.
> (with the headaches of "A{1000,2000}" left as an exercise to the read-
> er :-)).
easy enoungh to write, but probably easy to write an expression with
factorial complexity too, but this one should work, having at worst
two ways of matching any string.
(A{200}){5,9}A{0,200}
but
(A{5,10}){200}
is asking for trouble.