match - Boolean Result

suggest change

match? returns true or false to indicate whether the regexp matches, without updating $~ and the other match variables. If the second parameter is present, it is the position in the string where the search begins.

/R.../.match?("Ruby")    #=> true
/R.../.match?("Ruby", 1) #=> false
/P.../.match?("Ruby")    #=> false

match? was added in Ruby 2.4.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents