in reply to How to extract these groups of characters?

split:
use warnings; use strict; use Data::Dumper; my $str = 'joe 0.0000E 000 9.0720E-001 d23 9.0208E-001'; my @words = split /\s+/, $str; print Dumper(\@words); __END__ $VAR1 = [ 'joe', '0.0000E', '000', '9.0720E-001', 'd23', '9.0208E-001' ];

Replies are listed 'Best First'.
Re^2: How to extract these groups of characters?
by hippo (Archbishop) on Aug 26, 2015 at 08:23 UTC

    I think that to reflect the OP's requirement and keep the scientific notation numbers as single fields the split regex should be /\s\s+/ instead. In all other aspects the approach looks solid.