do not recompile regex patterns each time
Merge pull request #7 from idyedov/optimizations

do not recompile regex patterns each time