kulls has asked for the wisdom of the Perl Monks concerning the following question:
My test.txt containsopen(LOG,"test.txt"); my $pattern = '(\s+\w+\s+\d{2}\s\d{4}) | (Release\s+\d+\.\d+)'; while(<LOG>) { print $1 if($_ =~ /($pattern)/ ); }
I can't able to get the 'December 15 20005' value. please suggest any other pattern or why it's not returning?. I guess, either one of the pattern should match and it'll reflect in the $1.__DATA__ December 15 2005 some line Flat File Release 100.0 someline
2005-12-20 Retitled by g0n, as per Monastery guidelines
Original title: 'RegExp'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp for extracting date
by tirwhan (Abbot) on Dec 20, 2005 at 09:45 UTC | |
by kulls (Hermit) on Dec 20, 2005 at 10:15 UTC | |
|
Re: Regexp for extracting date
by McDarren (Abbot) on Dec 20, 2005 at 10:23 UTC | |
|
Re: Regexp for extracting date
by prasadbabu (Prior) on Dec 20, 2005 at 09:48 UTC |