"Joey Gibson" <joey / joeygibson.com> schrieb im Newsbeitrag news:4002A7D6.4090100 / joeygibson.com... > On 1/11/2004 9:06 AM, Robert Klemme wrote: > > >irb(main):002:0> "a= c+ a".scan( /\w+|=|\+/ ) > >=> ["a", "=", "c", "+", "a"] > >irb(main):003:0> "a= c+ a".scan( /\w+|=|\+|\s+/ ) > >=> ["a", "=", " ", "c", "+", " ", "a"] > > > >What are you missing? > > > > > > What about this? It produces what the original poster asked for in his > original message. > > "a= c+ a".split // > => ["a", "=", " ", "c", "+", " ", "a"] It's bad because it splits at every character and not tokens: irb(main):001:0> "foo bar".split // => ["f", "o", "o", " ", "b", "a", "r"] Definitely not a solution for the OP. robert