From: Daniel Baird Date: 2006-08-04T14:32:06+09:00 Subject: Re: A little regexp help for a newbie. 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)