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
Bryan R Harris mailto:[EMAIL PROTECTED] wrote:
: 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.
Can you give more than one example?
If everything fits this form, then don't look for numbers.
Just delete
Bryan R Harris wrote:
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 =
On 11/2/05, Bryan R Harris [EMAIL PROTECTED] wrote:
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 =
Bryan R Harris mailto:[EMAIL PROTECTED] wrote:
: 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.
Can you give more than one example?
The script is intended to normalize all the data in a file. It
Bryan R Harris wrote:
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)/;
Bryan R Harris wrote:
Bryan R Harris wrote:
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 =
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;
...