On Fri, 26 Jan 2007, Ricardo Ramalho wrote:

> I've tried the following regexp/string match:
>
> /^((?:\s*.+[;=][^,]*,?)+)$/ =~ " pid=934, time=478611,
> command=TMQFORWARD, args=-C dom=ccaApp -g 650 -i 4278 -u pthp68 -U
> /home1/eclprp/logs/tx/ULOG -m 0 -- -i 10 -t 600 -q AW02,AW02S TMQFORWARD
> -C dom=ccaApp -g 650 -i 4278 -u pthp68 -U /home1/eclprp/logs/tx/ULOG -m
> 0 -- -i 10 -t 600 -q AW02, "
>
> On a Debian/Linux system, with ruby version 1.8.4(-7sarge5) and even on
> the more recent 1.8.5(-4) ruby enters an infinite active loop, and never
> returns.
>
> Can anyone confirm/deny this possible bug on different architectures?
> Thanks.

it's just a bad regex.

   harp:~ > cat a.rb
   #! /usr/bin/env ruby

   re = /^((?:\s*[^,;=]+[;=][^,;=]+,?)+)$/

   s = " pid=934, time=478611, command=TMQFORWARD, args=-C dom=ccaApp -g 650 -i
   4278 -u pthp68 -U /home1/eclprp/logs/tx/ULOG -m 0 -- -i 10 -t 600 -q
   AW02,AW02S TMQFORWARD -C dom=ccaApp -g 650 -i 4278 -u pthp68 -U
   /home1/eclprp/logs/tx/ULOG -m 0 -- -i 10 -t 600 -q AW02, "

   m = re.match s

   puts m.to_a.first


   harp:~ > time ruby a.rb
    pid=934, time=478611, command=TMQFORWARD, args=-C dom=ccaApp -g 650 -i
   4278 -u pthp68 -U /home1/eclprp/logs/tx/ULOG -m 0 -- -i 10 -t 600 -q
   AW02,AW02S TMQFORWARD -C dom=ccaApp -g 650 -i 4278 -u pthp68 -U

   real    0m0.008s
   user    0m0.010s
   sys     0m0.000s



google 'exponential backtracking'

regards.

-a
-- 
we can deny everything, except that we have the possibility of being better.
simply reflect on that.
- the dalai lama