method

match?

Importance_1
v2_6_3 - Show latest stable - 0 notes - Class: Regexp
match?(*args) public

Returns a true or false indicates whether the regexp is matched or not without updating $~ and other related variables. If the second parameter is present, it specifies the position in the string to begin the search.

/R.../.match?("Ruby")    #=> true
/R.../.match?("Ruby", 1) #=> false
/P.../.match?("Ruby")    #=> false
$&                       #=> nil
Show source
Register or log in to add new notes.