From: Thomas Hurst Date: 2002-04-04T00:32:12+09:00 Subject: Re: regular expression question * Firestone, Mark - Technical Support (mark.firestone@gossgraphic.co.uk) wrote: > 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. String#split is more suited to this, being designed to split a string on arbitary boundaries: foo = bar.split(';') or to nuke whitespace around it: foo = bar.split(/\s*;\s*/) -- Thomas 'Freaky' Hurst - freaky@aagh.net - http://www.aagh.net/ - A well adjusted person is one who makes the same mistake twice without getting nervous.