%~% {tractor.base} | R Documentation |
Test if a the elements of a character vector match a Perl regular expression.
X %~% Y
X |
A character vector to test for a match. |
Y |
A character vector of length one representing a Perl regular expression to match against. |
This function is infix shorthand for regexpr(Y,X,perl=TRUE) != -1
.
TRUE if X
matches the regular expression described by Y
.
Jon Clayden
c("foo", "foo bar") %~% "\\w+\\s+(\\w+)?" # c(FALSE, TRUE)