问题 This question already has answers here : What is a regex to match ONLY an empty string? (9 answers) Closed 11 days ago . This may be a simple question to some: how do you actually match nothing using regex in R? Suppose you have a vector of strings such as this: q <- c("a", "12", "0", "", "300") And suppose further you want to match the empty string "" , how to go about this? It seems one can reasonably well match "" using grep to match the metacharacter . meaning 'any character', either as