From: William James Date: 2007-01-26T07:05:07+09:00 Subject: Re: Regexp and string halts ruby On Jan 25, 12:20 pm, 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. > > -- > Posted viahttp://www.ruby-forum.com/. Perhaps you should have done it this way: 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, " re = /[^\s;=]+[;=][^;=,\s]+/ p s.scan( re ) --- output ----- ["pid=934", "time=478611", "command=TMQFORWARD", "args=-C", "dom=ccaApp", "dom=ccaApp"]