From: Daniel Baird Date: 2006-08-04T15:00:34+09:00 Subject: Re: A little regexp help for a newbie. > > On 8/4/06, Robert Retzbach wrote: > > > What about "1a2+b".scan(/\d+) ? > > > It returns the numbers as array. > > Will this pick up negative numbers or floats? > Nope, only plain digits. if you want other stuff, you need to add it to the regex. /\d+/ ..is just digits /[+-]?\d+/ ..optional + or - /[+-]?\d+\.?\d*/ ..optional + or -, and optional . untested.. (sorry, too lazy to test :) -- Daniel Baird http://tiddlyspot.com (free, effortless TiddlyWiki hosting) http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog :: Things That Suck)