ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1027518 - /ant/core/trunk/docs/manual/Types/mapper.html
Date Tue, 26 Oct 2010 12:45:40 GMT
Author: bodewig
Date: Tue Oct 26 12:45:40 2010
New Revision: 1027518

URL: http://svn.apache.org/viewvc?rev=1027518&view=rev
Log:
clarify documentation on regexp mapper, suggestions by Francis Galiegue.  PR 47984

Modified:
    ant/core/trunk/docs/manual/Types/mapper.html

Modified: ant/core/trunk/docs/manual/Types/mapper.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/Types/mapper.html?rev=1027518&r1=1027517&r2=1027518&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/Types/mapper.html (original)
+++ ant/core/trunk/docs/manual/Types/mapper.html Tue Oct 26 12:45:40 2010
@@ -350,15 +350,22 @@ that don't match the <code>from</code> p
     <!--                                        -->
 
 <h4><a name="regexp-mapper">regexp</a></h4>
-<p>Both <code>to</code> and <code>from</code> are required
and define regular
-expressions. If the source file name matches the <code>from</code>
-pattern, the target file name will be constructed from the
+
+<p>Both <code>to</code> and <code>from</code> are required
and define
+regular expressions. If the source file name (as a whole or in part)
+matches the <code>from</code> pattern, the target file name will be
+constructed from the
 <code>to</code> pattern, using <code>\0</code> to <code>\9</code>
as
-back-references for the full
-match (<code>\0</code>) or the matches of the subexpressions in
-parentheses.
-Source
-files not matching the <code>from</code> pattern will be ignored.</p>
+back-references for the full match (<code>\0</code>) or the matches of
+the subexpressions in parentheses.  The <code>to</code> pattern
+determines the <strong>whole</strong> file name, so if you wanted to
+replace the extension of a file you should not use <code>from="\.old$"
+to=".new"</code> but rather <code>from="(.*)\.old$" to="\1.new"</code>
+(or rather use a glob mapper in this case).</p>
+
+<p>Source files not matching the <code>from</code> pattern will be
+ignored.</p>
+
 <p>Note that you need to escape a dollar-sign (<code>$</code>) with
 another dollar-sign in Ant.</p>
 <p>The regexp mapper needs a supporting library and an implementation



Mime
View raw message