Re: regex seg fault on long string

2004-12-02 Thread Paul Johnson
On Fri, Dec 03, 2004 at 12:16:57AM +, Jonathan Paton wrote: > > I suspect that you are just blowing the stack. > > Agreed now. Mind you, changing the program stack space > is not likely to help. Are you sure? Did you try it? I did ;-) > I don't think perl will use

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
Dear Paul, > > I believe the issue is related to an incorrect optimisation of the regex. > > Why do you think that? Changed my mind... :) The (even shorter) regex: /(1?)*/ Compiles as: 1: CURLYX[0] {0,32767}(12) 3: OPEN1(5) 5: CURLY {0,1}(9) 7: EXACT <1>(0) 9: CL

Re: regex seg fault on long string

2004-12-02 Thread Paul Johnson
On Thu, Dec 02, 2004 at 10:33:12PM +, Jonathan Paton wrote: > Couldn't leave this one alone :) I now have a minimised test case: > > $msgs = '1' x 10; > $msgs =~ /(1_?)*/; > > I believe the issue is related to an incorrect optimisation of the regex. Why do you think that? I suspect th

Re: regex seg fault on long string

2004-12-02 Thread Dave Gray
On Thu, 2 Dec 2004 17:19:00 -0500, Dave Gray <[EMAIL PROTECTED]> wrote: > > Is there a more compatible way to check my overly-long string? > > How about: > > die "syntax error\n" if $msgs =~ /[^\d,]/; Oh, I missed a requirement... after the above code: while ($msgs =~ /(\d+)/g) { die "syntax

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
Dear Jeremy, Couldn't leave this one alone :) I now have a minimised test case: $msgs = '1' x 10; $msgs =~ /(1_?)*/; I believe the issue is related to an incorrect optimisation of the regex. Not much mentioned in the version delta files, so I wonder if 5.8.5 has the bug but didn't manifest

Re: regex seg fault on long string

2004-12-02 Thread Dave Gray
> Is there a more compatible way to check my overly-long string? How about: die "syntax error\n" if $msgs =~ /[^\d,]/; Cheers, Dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
Dear Jeremy, Congratulations, you've found a bug in perl. Check the delta files (perldoc perl585delta etc) to see if there is a mention of something similar. If not, file the bug report using the perlbug tool. [EMAIL PROTECTED] jonathan]$ perl foreach my $number (0 .. 100) { $msgs .= "$nu

regex seg fault on long string

2004-12-02 Thread Jeremy Kister
I am dealing with a problem that I have compressed down to the following code: foreach my $number (0 .. 6129){ $msgs .= "$number,"; } unless($msgs =~ /^(\d+,?)+$/){ die "syntax error"; } What's happening is that when i try to apply my regex to my string -- with the comma seperator -- , I