Filename Validation

I'm going through a script someone wrote and has left the company.

I've a file_name -> s31-d173-lookup-20060502111140-sr

In the ksh this is a validation :

if [[ (${file_name} = @(IG([0-9]|[0-9][0-9])-(*)-(*)-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-([0-9][0-9]|[0-9][0-9]-[0-9][0-9])-sr)) ]];

The validation for the above file_name fails. Any idea why and what is file
naming convention the validation expecting ?? Thanks.

Regards,
F1

You're not too close to a match there... The name must start out something like:
IG1-this-that-
IG99-this-that-
The IG is required, then one or two digits, then a dash, then anything followed by a dash and anything followed by a dash. Next you need a long string of digits, a dash, and shorter string of digits and a dash. Next you get a choice: two digits or two digits, a dash, and two more digits. A final -sr is required.

I managed to figure out the required format. That is -

IG(X|XX)-ABC-ABC-XXXXXXXXXXXXXX-XXXX-(XX|XX-XX)-sr

Thanks for your time. Appreciated. :slight_smile:

Regards,
F-1