moved regexp escape into separate file