re.escape os.sep so that \ is interpreted properly in the regex.