Link to home
Start Free TrialLog in
Avatar of msibley
msibleyFlag for United States of America

asked on

Perl search string, validation

I need a perl search string to validate filenames as I iterate through them.

The filenames should all:
Have 25 characters plus the extension (.xlsx), for example: TESTY_ClinicalQ_20171104.xlsx
First 5 characters: caps alphabetic
underscore
"ClinicalQ" just as it is (first character capital C, then lowercase "linical", then capital Q)
underscore
Then 8 numeric characters
.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of msibley

ASKER

Another REGEX wizard to the rescue! Thanks!
And this part:
    [0-9]{8}
can be abbreviated to:
    \d{8}
And  
  .
should be
 \.
And you might like to put a $ near the end like:
    xlsx$/
if you want to ensure it matches nothing after that, like:
    TESTY_ClinicalQ_20171104.xlsx.old