fork download
  1. a <- c("12", "13", "112", "123", "113", "1123", "23","212", "223","213","2123","312", "323", "313","3123", "1223","1213","12123","2313", "23123","13123")
  2. x <- grep('^[123]{3}$', a, value=TRUE)
  3. unique(x)
  4.  
  5. grep('^(?!.*(.).*\\1)[123]{3}$', a, value=TRUE, perl=TRUE)
  6.  
Success #stdin #stdout 0.3s 22832KB
stdin
Standard input is empty
stdout
[1] "112" "123" "113" "212" "223" "213" "312" "323" "313"
[1] "123" "213" "312"