Skip to content
Prev 367427 / 398503 Next

Replace Text but not from within a word

Hi,

See ?regex and ?grep for some details and examples on how to construct the expression used for matching, as well as some of the references therein.

In this case, you want to use something along the lines of:
[1] "BOEING"             "ENGMANTAYLOR"       "SAGINAW COUNTY INC"

where the "CO" is preceded by a space and followed by the "$", which is a special character that indicates the end of the string to be matched.

Regards,

Marc Schwartz