"for some reason..."
SUBSTRING() does not work with wildcards.
Something like this should do the trick:
upper(left(token( @FileName,"\\",tokencount( @FileName, "\\" )), 3)) == "XYZ" && upper(right(token( @FileName,"\\",tokencount( @FileName, "\\" )),4)) == ".XLS"?"TRUE":"FALSE"