File validation now using Regular Expression

File validation now using Regular Expression to improve flexibility and
more customizable