I have this list of strings:
stringg <- c("csv.asef", "ac ed", "asdf$", "asdf", "dasf]", "sadf {sadf")
if I want to get all strings containing special characters like so:
grep("[:punct:]+", stringg, value = TRUE)
--------------------------------------------
Result:
[1] "csv.asef" "ac ed"
What I should get is:
[1] "csv.asef" "asdf$" "dasf]" "sadf {sadf"
if I use:
grep("[!\\"#$%&’()*+,-./:;<=>?@[]^_`{|}~.]+", stringg, value = TRUE)
-----------------------------------------------------------------
Result is ERROR
I want these special characters: € ! " # $ % & ’ ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~. which [:punct:] doesn't have
I know if I want the strings not containing any of those characters then I would use:
[^ € ! " # $ % & ’ ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~.]
but how do I do it with [:punct:]:
[^:punct:]?
[^:punct:]{0}?
and how could i combine ^[:punct:] | ^€ ?
many thanks