From: RJ Melton Date: 2006-08-04T14:39:21+09:00 Subject: Re: A little regexp help for a newbie. ------=_Part_24345_11059296.1154669958708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I tried that and it works fine, optimal or not. Thanks. :) On 8/3/06, Daniel Baird wrote: > > On 8/4/06, RJ Melton wrote: > > Anyway, I have a simple string in the format 1a2+3 and want to basically > > take out the non-number bits and put the numbers into an array. > > It also has to match more than single-digit numbers. > > I'm pretty sure this is non-optimal, but you could use String.split: > > "1a23+4-123".split(/[^\d]/) > > the argument to split is a regex that matches anything that's not a > digit ( \d is a digit; [^\d] is anything but that). split uses that > argument to decide where to split the string up. > > ;D > > -- > Daniel Baird > http://tiddlyspot.com (free, effortless TiddlyWiki hosting) > http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog :: > Things That Suck) > > -- R.J. Melton ------=_Part_24345_11059296.1154669958708--