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.
In reply to Re^2: pull out num from str
by jwkrahn
in thread pull out num from str
by icoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |