Bindo has asked for the wisdom of the Perl Monks concerning the following question:
Greetings good people! I just want to find all the directories containig only numbers and assign them to an array. For an instance I would want isolate the directories in a certain partition with this format "20130411". Not "2013.kjh" or "NN.201304", or "2013mmkk04". Following is what I tried but they returns not only what i want but the ones with letters
my @LOGDIR = <*>; foreach my $DIR(@LOGDIR) { if($DIR =~ m/([\d])/){ print "$DIR\n"; } }
Please can someone help. Many thanks in advance.
Bindo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex pattern to find directories only with digits
by hdb (Monsignor) on Apr 11, 2013 at 10:01 UTC | |
by Bindo (Acolyte) on Apr 11, 2013 at 11:22 UTC | |
Re: Regex pattern to find directories only with digits
by reisinge (Hermit) on Apr 11, 2013 at 11:32 UTC | |
Re: Regex pattern to find directories only with digits
by Krambambuli (Curate) on Apr 11, 2013 at 10:23 UTC | |
by Bindo (Acolyte) on Apr 11, 2013 at 11:42 UTC | |
Re: Regex pattern to find directories only with digits
by tobias_hofer (Friar) on Apr 11, 2013 at 10:26 UTC | |
Re: Regex pattern to find directories only with digits
by graff (Chancellor) on Apr 12, 2013 at 03:03 UTC | |
by Bindo (Acolyte) on Jun 20, 2013 at 10:19 UTC | |
by gurpreetsingh13 (Scribe) on Jun 20, 2013 at 10:40 UTC |
Back to
Seekers of Perl Wisdom