set.regex and substring substitution