We can try sub
sub("(V).*(neck)", "\\1 \\2", words_1)
#[1] "V neck" "V neck" "V neck"
Or a general approach would be
sub("([A-Z]+)[^A-Za-z]*([a-z]+)", "\\1 \\2", words_1)
2
solved Matching and replacement with gsub [closed]
We can try sub
sub("(V).*(neck)", "\\1 \\2", words_1)
#[1] "V neck" "V neck" "V neck"
Or a general approach would be
sub("([A-Z]+)[^A-Za-z]*([a-z]+)", "\\1 \\2", words_1)
2
solved Matching and replacement with gsub [closed]