/* * call-seq: * rxp.match(str) => matchdata or nil * * Returns a <code>MatchData</code> object describing the match, or * <code>nil</code> if there was no match. This is equivalent to retrieving the * value of the special variable <code>$~</code> following a normal match. * * /(.)(.)(.)/.match("abc")[2] #=> "b" */ static VALUE rb_reg_match_m(re, str) VALUE re, str; { VALUE result = rb_reg_match(re, str); if (NIL_P(result)) return Qnil; result = rb_backref_get(); rb_match_busy(result); return result; }