string.c:1074
static VALUE
rb_str_match2(str)
    VALUE str;
{
    StringValue(str);
#if RUBY_VERSION_CODE < 181
	rb_warn("~string will be obsolete; use explicit regexp");
#endif
    return rb_reg_match2(rb_reg_regcomp(rb_reg_quote(str)));
}
