From: ara.t.howard@... Date: 2006-02-05T11:47:50+09:00 Subject: Re: Scanning a string for decimal numbers On Sun, 5 Feb 2006, Ernest Ellingson wrote: > Kent Sibilev wrote: >> "24,4 + 55,2".scan /[\d,]+/ >> >> Kent >> >> On 2/4/06, Jeppe Jakobsen wrote: >>> Hi all, how do you scan a string and avoid getting my decimal numbers >>> divided into 2 numbers. >>> >>> Example: >>> >>> a = "24,4 + 55,2" >>> a.scan! (/\d+/) >>> puts a >>> >>> my output for a will be: >>> 24 >>> 4 >>> 55 >>> 2 >>> >>> But I want to keep my decimal numbers intact like this: >>> 24,4 >>> 55,2 >>> >>> >>> How do I solve this problem without putting the numbers into seperate >>> strings? >>> >>> >> >> > try > a.scan!(/\d+,\d+/) > Ernie careful. you'll kill negatives. -a -- happiness is not something ready-made. it comes from your own actions. - h.h. the 14th dali lama