Implement regex function
Get file extension