x <- c("Ab"," d","#12"," ",".1", "m.","", "$y")
y <- c(".x", " .","c.", "$y", "_p","12")
grepnot("^A[[:alpha:]]+",x) # "Ab" "\" " d" "#12" " " ".1" "m." "" "$y"
grepnot("A[[:alpha:]]+",x) # "Ab" "\" " d" "#12" " " ".1" "m." "" "$y"
grepnot("a[[:alpha:]]+",x) # "\" ...
grepnot("#[[:alnum:]]+",x) # "#12" "\" ...
grepnot("$",x) # "" "\" ...
grepnot("[^$][[:alnum:]].]+",x) # "\" ...
grepnot("[^[$]][[:alnum:]].]+",x) # "\" ...
grepnot("^.[[:alpha:]]+",x,FALSE) # "1" "2" "\" "3" "4" "5" "6" "7"
Run the code above in your browser using DataLab