in reply to Regular Expression Assistance

Not sure I follow, but you can build on this:
use warnings; use strict; while (<DATA>) { chomp; if (/ ^ [cljso] \d{4} _ \d*? \. (dat|idx) $ /ix) { print "$_ : match\n"; } else { print "$_ : no match\n"; } } __DATA__ C1234ABC.IDX C1234_ABC.IDX C1234_.IDX

prints:

C1234ABC.IDX : no match C1234_ABC.IDX : no match C1234_.IDX : match