[Swift-commit] r3158 - trunk/docs

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Oct 13 23:53:37 CDT 2009


Author: hategan
Date: 2009-10-13 23:53:36 -0500 (Tue, 13 Oct 2009)
New Revision: 3158

Modified:
   trunk/docs/userguide.xml
Log:
added mention that the capture group references for the regexp mapper need to be specified with two backslashes instead of one

Modified: trunk/docs/userguide.xml
===================================================================
--- trunk/docs/userguide.xml	2009-10-13 22:35:54 UTC (rev 3157)
+++ trunk/docs/userguide.xml	2009-10-14 04:53:36 UTC (rev 3158)
@@ -1220,8 +1220,9 @@
     <row><entry>match</entry><entry>Regular expression pattern to match, use
 <literal>()</literal> to match whatever regular expression is inside the
 parentheses, and indicate the start and end of a group; the contents of a
-group can be retrieved with the <literal>\number</literal> special
-sequence</entry></row>
+group can be retrieved with the <literal>\\number</literal> special sequence 
+(two backslashes are needed because the backslash is an escape sequence introducer)
+</entry></row>
     <row><entry>transform</entry><entry>The pattern of the file name to
 transform to, use <literal>\number</literal> to reference the
 group matched.</entry></row>
@@ -1235,7 +1236,7 @@
   file f <regexp_mapper;
     source=s,
     match="(.*)gif",
-    transform="\1jpg">; </programlisting>
+    transform="\\1jpg">; </programlisting>
 
 This example transforms a string ending <literal>gif</literal> into one
 ending <literal>jpg</literal> and maps that to a file.




More information about the Swift-commit mailing list