rinkish85 has asked for the wisdom of the Perl Monks concerning the following question:
I am looking for an regular expression to match the file name. I got an array which contains file names like:
log4perl.appender1996:06:58:12.General_Information.ErrorLog log4perl_LogicModules.appender1996:07:56:12CSS.General_Information_hel +p.ErrorLog
log4perl.Edition1998:06:56:12.General_Information.ErrorLog log4perl_Eventsource.Edition1998:06:56:12CSS.General_Information-colle +ctor_1.ErrorLog
log4perl.Advanced1999:06:56:12.General_Information.ErrorLog log4perl.Advanced1999:06:56:12CSS.General_Information-collector-2.Erro +rLog
So if i take an example for below files
log4perl.Advanced1999:06:56:12.General_Information.ErrorLog log4perl.Advanced1999:06:56:12CSS.General_Information-collector-2.Erro +rLog
I need an regular expression which matches the format of my files and removes "CSS" after string "Advanced1999:06:56:12CSS" in second file and keep both the files in array.
File name format : <(alphanumericString,_)>.<(alphanumericUniqueIdentifier,.)>.<(alphanumericString2,_,-)>.ErrorLog<(alphanumericUniqueIdentifier,.)> is appended with constant "CSS" sometimes with alphanumericUniqueIdentifier
So after removing CSS in need below files in array
Thanks.log4perl.Advanced1999:06:56:12.General_Information.ErrorLog log4perl.Advanced1999:06:56:12.General_Information-collector-2.ErrorLo +g
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl file name parsing - Regular expression
by Athanasius (Archbishop) on May 30, 2017 at 03:47 UTC | |
by rinkish85 (Novice) on May 30, 2017 at 06:28 UTC | |
by Laurent_R (Canon) on May 30, 2017 at 08:20 UTC | |
Re: Perl file name parsing - Regular expression
by shmem (Chancellor) on May 30, 2017 at 05:40 UTC | |
by rinkish85 (Novice) on May 30, 2017 at 06:32 UTC | |
Re: Perl file name parsing - Regular expression
by Anonymous Monk on May 30, 2017 at 05:53 UTC |