Replace re.search + re.escape with a faster string search
Remove unneeded imports
Merge pull request #389 from cmc333333/perf-re-search

Performance Tweak 2: Replace re.search + re.escape with a faster string search