Improve regex compatibility