I'd like to snag all the whitespace padded numbers in $_ into an array, e.g.
in the following:

1 "M_fx,-3,+2.p2" -31.4e-1 4.

I'd like to pick up only the 1, -31.4e-1, and 4.

I've tried:

$ss = qr/(^|\s)[+-]?[0-9]+\.?[0-9]*([eE][+-]?[0-9]+\.?[0-9]*)?($|\s)/;
@list = m/$ss/g;

... but it slurps up the leading whitespace if it's there, and misses every
other number, amid other problems.  I'd love to use \b, but it doesn't work
if there are "-" or "+" at the leading edge.

Any good ideas on how to do this?

- Bryan





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to