/* * call-seq: * str.match(pattern) => matchdata or nil * * Converts <i>pattern</i> to a <code>Regexp</code> (if it isn't already one), * then invokes its <code>match</code> method on <i>str</i>. * * 'hello'.match('(.)\1') #=> #<MatchData:0x401b3d30> * 'hello'.match('(.)\1')[0] #=> "ll" * 'hello'.match(/(.)\1/)[0] #=> "ll" * 'hello'.match('xx') #=> nil */ static VALUE rb_str_match_m(str, re) VALUE str, re; { return rb_funcall(get_pat(re, 0), rb_intern("match"), 1, str); }