[R] Names in vector occurring in another vector I have a vector of character strings such as mainnames<-c("CAD","AUD") and another vector say checknames<-c("CAD.l1","AUD.l1","JPY.l1","EUR.l1","CAD.l2","AUD.l2","JPY .l2","EUR.l2") I want a new vector of character strings that is just resultnames<-c("JPY.l1","EUR.l1","JPY.l2","EUR.l2") Because any time a name occurs in checknames that has a subset that matches with mainnames, the name in checknames should not be in the final result !!!!!!!!!!!!!!!!! I can't use %in% because this example doesn't require exact matching. The general problem would always have an  "el after the dot but the numbers can go upto double digits. Thanks a lot. 	 mark -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/se...{{dropped}} ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.