From: David Alan Black Date: 2002-04-04T00:59:12+09:00 Subject: Re: regular expression question Hello -- On Thu, 4 Apr 2002, Firestone, Mark - Technical Support wrote: > Thanks for the help with the tread questions guys... I have one about (gasp) > regular expresions. hate hate hate. > > I want to seperate a string of commands seperated by semi-colons... > > here's what I have so far by way of a test... > > happy = input.scan(/[0-9 a-z]+(?=;)/) > > this does what I want, almost. I only get strings with semicolons AFTER > them. This cuts off the last command in the list.. how can I get ALL the > strings SEPERATED by semicolons. Just for fun, here's a pretty concise way to do this with #scan: input.scan(/[^;]+/) meaning: scan for sequences of consecutive characters which are not semi-colons. (I'd still use #split, but anyway.) > Regular expressions give me a headache.. I wish I had the power to convey their coolness. I'm actually surprised that anti-regex sentiment crops up as often as it does.... I've always thought they were so elegant and powerful, and it took me a while to notice that not everyone agreed :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav