match - Boolean Result
suggest changematch? 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents