in reply to Numerical Regular Expression for pattern match
Using your example, and putting this into a short script:m/([+\-]?[0-9\.]+)/g;
Which gives:#!/usr/bin/perl -w use strict; use Data::Dumper::Simple; my @numbers; while (<DATA>) { @numbers = $_ =~ m/([+\-]?[0-9\.]+)/g; } print Dumper(@numbers); __DATA__ iters = 320 (3.05s) aver = 9568.34 us (9603.45 us, 1.01s, 99.79%)
Does this help?@numbers = ( '320', '3.05', '9568.34', '9603.45', '1.01', '99.79' );
Cheers,
Darren :)
|
|---|