Escape RegExp

Latest commit breaks the task in Windows. Creating a RegExp from path.sep will throw an error on windows because the backslash needs to be escaped. Added code to do this.