pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Extending Regular Expression bounds limit of 255.
9+ messages / 5 participants
[nested] [flat]

* Extending Regular Expression bounds limit of 255.
@ 2010-05-27 19:33  Brent DeSpain <bd.postgres@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Brent DeSpain @ 2010-05-27 19:33 UTC (permalink / raw)
  To: pgsql-sql

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.

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-27 20:59  Andrej <andrej.groups@gmail.com>
  parent: Brent DeSpain <bd.postgres@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Andrej @ 2010-05-27 20:59 UTC (permalink / raw)
  To: Brent DeSpain <bd.postgres@gmail.com>; +Cc: pgsql-sql

On 28 May 2010 07:33, Brent DeSpain <bd.postgres@gmail.com> 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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-27 22:44  Brent DeSpain <bd.postgres@gmail.com>
  parent: Andrej <andrej.groups@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Brent DeSpain @ 2010-05-27 22:44 UTC (permalink / raw)
  To: Andrej <andrej.groups@gmail.com>; +Cc: pgsql-sql

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:
> > 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
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-27 22:55  Brent DeSpain <bd.postgres@gmail.com>
  parent: Brent DeSpain <bd.postgres@gmail.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Brent DeSpain @ 2010-05-27 22:55 UTC (permalink / raw)
  To: Andrej <andrej.groups@gmail.com>; +Cc: pgsql-sql

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.


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:
>> > 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
>>
>
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-28 15:14  alvherre <alvherre@commandprompt.com>
  parent: Brent DeSpain <bd.postgres@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: alvherre @ 2010-05-28 15:14 UTC (permalink / raw)
  To: Brent DeSpain <bd.postgres@gmail.com>; +Cc: Andrej <andrej.groups@gmail.com>; pgsql-sql

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 <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-28 15:44  Brent DeSpain <bd.postgres@gmail.com>
  parent: alvherre <alvherre@commandprompt.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Brent DeSpain @ 2010-05-28 15:44 UTC (permalink / raw)
  To: alvherre <alvherre@commandprompt.com>; +Cc: Andrej <andrej.groups@gmail.com>; pgsql-sql

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.


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 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 <alvherre@commandprompt.com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-29 10:27  Jasen Betts <jasen@xnet.co.nz>
  parent: Brent DeSpain <bd.postgres@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Jasen Betts @ 2010-05-29 10:27 UTC (permalink / raw)
  To: pgsql-sql

On 2010-05-27, Brent DeSpain <bd.postgres@gmail.com> 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.




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-29 18:56  Tim Landscheidt <tim@tim-landscheidt.de>
  parent: Jasen Betts <jasen@xnet.co.nz>
  0 siblings, 1 reply; 9+ messages in thread

From: Tim Landscheidt @ 2010-05-29 18:56 UTC (permalink / raw)
  To: pgsql-sql

Jasen Betts <jasen@xnet.co.nz> 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




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Extending Regular Expression bounds limit of 255.
@ 2010-05-30 10:37  Jasen Betts <jasen@xnet.co.nz>
  parent: Tim Landscheidt <tim@tim-landscheidt.de>
  0 siblings, 0 replies; 9+ messages in thread

From: Jasen Betts @ 2010-05-30 10:37 UTC (permalink / raw)
  To: pgsql-sql

On 2010-05-29, Tim Landscheidt <tim@tim-landscheidt.de> wrote:
> Jasen Betts <jasen@xnet.co.nz> 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.




^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2010-05-30 10:37 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-05-27 19:33 Extending Regular Expression bounds limit of 255. Brent DeSpain <bd.postgres@gmail.com>
2010-05-27 20:59 ` Andrej <andrej.groups@gmail.com>
2010-05-27 22:44   ` Brent DeSpain <bd.postgres@gmail.com>
2010-05-27 22:55     ` Brent DeSpain <bd.postgres@gmail.com>
2010-05-28 15:14       ` alvherre <alvherre@commandprompt.com>
2010-05-28 15:44         ` Brent DeSpain <bd.postgres@gmail.com>
2010-05-29 10:27       ` Jasen Betts <jasen@xnet.co.nz>
2010-05-29 18:56         ` Tim Landscheidt <tim@tim-landscheidt.de>
2010-05-30 10:37           ` Jasen Betts <jasen@xnet.co.nz>

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