Improvements to regex performance.
Merge pull request #7069 from JuliaLang/dcj/slow-regex

Improvements to regex performance.