instance method
Regexp#inspect
() -> ::String
inspect → string
re.c
View on GitHub ↗
static VALUE
rb_reg_inspect(VALUE re)
{
if (!RREGEXP_PTR(re) || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
return rb_any_to_s(re);
}
return rb_reg_desc(re);
}
Returns a nicely-formatted string representation of self:
Example
/ab+c/ix.inspect # => "/ab+c/ix"
Related: Regexp#to_s.