Extracted all used regexes in the comm layer and precompiled them

Possible improvement of #390