aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/re.c b/re.c
index 0ecaccccfd..d59357a21e 100644
--- a/re.c
+++ b/re.c
@@ -1221,6 +1221,19 @@ match_string(VALUE match)
return RMATCH(match)->str; /* str is frozen */
}
+/*
+ * call-seq:
+ * mtch.inspect => str
+ *
+ * Returns a printable version of <i>mtch</i>.
+ *
+ * /.$/ =~ "foo"; puts $~.inspect
+ * #=> #<MatchData "o">
+ *
+ * /(.)(.)(.)/ =~ "foo"; puts $~.inspect
+ * #=> #<MatchData "foo" "f" "o" "o">
+ */
+
static VALUE
match_inspect(VALUE match)
{