I’ve just come across this in javascript which seems to be testing for regular expressions:
/hello/.test("hello") //Returns true
However I cannot find the documentation for this, no matter what I search.
Can anyone help me out?
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.
.testRegular expressions objects also have a method called
.exec.For future reference a search like “RegExp test mdc” will find you the documentation. Alternatively if you are brave you can search through the ES5 spec but that’s a dry read.