grepl("(?x)[Aa][Bb][Cc]x | [Aa][Bb][Cc]y", c("Abcx", "abCy"), perl=TRUE)
Standard input is empty
[1] TRUE TRUE
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!