http://qs321.pair.com?node_id=1028110


in reply to Regex pattern to find directories only with digits

This will also find files with names consisting of digits only...

use strict; my @LOGDIR = <*>; foreach my $DIR(@LOGDIR) { if($DIR =~ m/^(\d+)$/){ print "$DIR\n"; } }

Replies are listed 'Best First'.
Re^2: Regex pattern to find directories only with digits
by Bindo (Acolyte) on Apr 11, 2013 at 11:22 UTC

    Thank you very much sir this is exactly what I was looking for. :)