if ‘A*B*C*D*’ is a regular expression, and
string <- c("AB"),
is there a way to check whether the string is accepted by the regular expression? The kind of answer would be yes or no.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sounds like you’re looking for
grep:I’ve added the
^and$to ensure that only the entire string can be matched. If you don’t want that, simply remove them.