How can I detect non-ascii characters in a vector f strings in a grep like fashion. For example below I\'d like to return c(1, 3) or c(TRUE, FALSE, TRUE,
c(1, 3)
c(TRUE, FALSE, TRUE,
Came across this later using pure base regex and so simple:
grepl("[^ -~]", x) ## [1] TRUE FALSE TRUE FALSE
More here: http://www.catonmat.net/blog/my-favorite-regex/