in reply to Extracting datapart (YYYYMMDD) with filename regular expression

#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1177054 use strict; use warnings; my $date; ($date) = /\b(2\d{7})\b/ and print $date while <DATA>; __DATA__ apachelog_LT100.7.7.7_21.SRV.apache.20161130-123456.258976.log APACHE_PP1.20161130-12:39:55-30822.Release.LT100.7.7.7.PP1.log APACHE_PS_PP1.20161130-15:29:37-5319.ebf_run.LT100.7.7.7.log
  • Comment on Re: Extracting datapart (YYYYMMDD) with filename regular expression
  • Download Code