Escape special characters before use in regex.