Method: U::String#match
- Defined in:
- ext/u/rb_u_string_match.c
#match(pattern, index = 0) ⇒ MatchData? #match(pattern, index = 0) {|matchdata| ... } ⇒ Object?
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'ext/u/rb_u_string_match.c', line 52
VALUE
rb_u_string_match_m(int argc, VALUE *argv, VALUE self)
{
VALUE re;
if (argc < 0)
need_m_to_n_arguments(argc, 1, 2);
re = argv[0];
argv[0] = self;
VALUE result = rb_funcall2(rb_u_pattern_argument(re, false),
rb_intern("match"), argc, argv);
if (!NIL_P(result) && rb_block_given_p())
return rb_yield(result);
return result;
}
|