in reply to Two regex problems (easy)

I would contend that you shouldn't even use a regex to solve this problem, since the problem pertains to decoding the data stored within a fixed-width columnar format.

For this, the appropriate tool is unpack:

#!/perl/bin/perl use strict; use warnings; use Data::Dumper; my $str = '06/19/2007 10:50 AM <DIR> 1dfgfg'; my $spec = 'A12A12A15A10'; # adjust this spec to meet your columnar ne +eds my @arr = unpack($spec, $str); print Dumper(\@arr); print "\n"; print "username is ", $arr[3], "\n"; print "\n"; __OUTPUT__ $VAR1 = [ '06/19/2007', '10:50 AM', '<DIR>', '1dfgfg' ]; username is 1dfgfg

Where do you want *them* to go today?