/* * call-seq: * mtch.post_match => str * * Returns the portion of the original string after the current match. * Equivalent to the special variable <code>$'</code>. * * m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie") * m.post_match #=> ": The Movie" */ VALUE rb_reg_match_post(match) VALUE match; { VALUE str; long pos; if (NIL_P(match)) return Qnil; if (RMATCH(match)->BEG(0) == -1) return Qnil; str = RMATCH(match)->str; pos = RMATCH(match)->END(0); str = rb_str_substr(str, pos, RSTRING(str)->len - pos); if (OBJ_TAINTED(match)) OBJ_TAINT(str); return str; }