R Ignore character within a Regex string
问题 I've looked all over for some regex that will cause R to disregard the next character within a regular expression string. For example, given myvector : myvector <- c("abcdef", "ghijkl", "mnopqrs") and a regex string: regexstring <- "[a-z]{3}XXXXXXXXX " which includes some unknown characters XXXXXXXXX, I want to tell R to ignore the final space in the regular expression string itself. After running the following, regexstring <- "[a-z]{3} " sub(regexstring, " ", myvector) gives, "abcdef"