Added regex for extension checking.