Escape regex special characters in rules