source()
public
Returns the original string of the pattern.
/ab+c/ix.source
Note that escape sequences are
retained as is.
/\x20\+/.source
Show source
static VALUE
rb_reg_source(VALUE re)
{
VALUE str;
rb_reg_check(re);
str = rb_enc_str_new(RREGEXP_SRC_PTR(re),RREGEXP_SRC_LEN(re), rb_enc_get(re));
if (OBJ_TAINTED(re)) OBJ_TAINT(str);
return str;
}