From the thread: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/8344
> On 7/21/06, ts <decoux / moulon.inra.fr> wrote:
> > "\\'" is the same than $', i.e. MatchData#post_match. For example
>
> Now that makes more sense... I didn't know that. After looking in the
> documentation, I found this only in PickAxe book. I haven't found it
> neither in the 1.8 RDoc nor in the mentioned article.
>
> Attached is a patch against 1.182.2.48 revision of string.c, that adds
> these sequences to rdoc (shamelessly ripped from the pickaxe book).
--- string.c.orig Fri Jul 21 20:43:50 2006
+++ string.c Fri Jul 21 20:51:17 2006
@@ -2015,9 +2015,14 @@
*
* If the method call specifies <i>replacement</i>, special variables such as
* <code>$&</code> will not be useful, as substitution into the string occurs
- * before the pattern match starts. However, the sequences <code>\1</code>,
- * <code>\2</code>, etc., may be used.
- *
+ * before the pattern match starts. However, the following sequences may be used:
+ *
+ * \1,\2,...\9 The value matched by the <i>nth</i> grouped subexpression
+ * \& The last match
+ * \` The part of the string before the match
+ * \' The part of the string after the match
+ * \+ The highest-numbered group matched
+ *
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
* <code>$&</code>, and <code>$'</code> will be set appropriately. The value
@@ -2204,7 +2209,7 @@
* (such as <code>$&</code> and <code>$1</code>) cannot be substituted into it,
* as substitution into the string occurs before the pattern match
* starts. However, the sequences <code>\1</code>, <code>\2</code>, and so on
- * may be used to interpolate successive groups in the match.
+ * (see <code>String::sub</code>) may be used to interpolate successive groups in the match.
*
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
|