in reply to Re: pull out num from strin thread pull out num from str
You can also drop the .* from the beginning
"123 456" =~ /([+-]?\d+)/ and "123 456" =~ /.*([+-]?\d+)/ match two different things because .* at the beginning is greedy.