Add RegX instead of string comparisons for file extensions.
Add RegX instead of string comparisons for file extensions.