I know this is an ugly script but it does the job. What I am facing now is adding a few more extensions what would clutter the scrip even more. How can I make it more modular? Specifically, how can I write this long regular expression (source file extensions) on multiple lines? say one extension on each line. I guess I am doing something wrong with string concatenation but not quite sure what exactly. Here's the original file:I know this is an ugly script but it does the j