I need to find a regexp that allows me to find strings in which i have all the required numbers but only once.
For example:
a <- c(\"12\",\"13\",\
you can as well use this
grep('^([123])((?!\\1)\\d)(?!\\2|\\1)\\d', a, value=TRUE, perl=T)
see demo