Escape user-generated input for regex matches.