a <- c("12", "13", "112", "123", "113", "1123", "23","212", "223","213","2123","312", "323", "313","3123", "1223","1213","12123","2313", "23123","13123")
x <- grep('^[123]{3}$', a, value=TRUE)
unique(x)
grep('^(?!.*(.).*\\1)[123]{3}$', a, value=TRUE, perl=TRUE)
YSA8LSBjKCIxMiIsICIxMyIsICIxMTIiLCAiMTIzIiwgIjExMyIsICIxMTIzIiwgIjIzIiwiMjEyIiwgIjIyMyIsIjIxMyIsIjIxMjMiLCIzMTIiLCAiMzIzIiwgIjMxMyIsIjMxMjMiLCAiMTIyMyIsIjEyMTMiLCIxMjEyMyIsIjIzMTMiLCAiMjMxMjMiLCIxMzEyMyIpCnggPC0gZ3JlcCgnXlsxMjNdezN9JCcsIGEsIHZhbHVlPVRSVUUpCnVuaXF1ZSh4KQoKZ3JlcCgnXig/IS4qKC4pLipcXDEpWzEyM117M30kJywgYSwgdmFsdWU9VFJVRSwgcGVybD1UUlVFKQo=