ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17660] New: - additional example for <replaceregexp>
Date Wed, 05 Mar 2003 08:13:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17660>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17660

additional example for <replaceregexp>

           Summary: additional example for <replaceregexp>
           Product: Ant
           Version: 1.6Alpha (nightly)
          Platform: Other
               URL: http://cvs.apache.org/viewcvs.cgi/*checkout*/ant/docs/ma
                    nual/OptionalTasks/replaceregexp.html?rev=1.13
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Documentation
        AssignedTo: dev@ant.apache.org
        ReportedBy: jan@materne.de


On the user-list (http://marc.theaimsgroup.com/?l=ant-
user&m=104680092326232&w=2) there was a discussion how to get rid off multiple 
whitespaces. As far as I know this wasn´t for the first time. So an additional 
example could help:

<pre>&lt;replaceregexp match="\s+" replace=" " flags="g" byline="true"&gt;
    &lt;fileset dir="${html.dir}" includes="**/*.html" /&gt;
&lt;/replaceregexp&gt;
</pre>
<p>replaces all whitespaces (blanks, tabs, etc) by one blank remaining the
line separator. So with input
<pre>
&lt;html>    &lt;body&gt;
&lt;&lt;TAB&gt;&gt;&lt;h1&gt;    T E S T   &lt;/h1&gt;  &lt;&lt;TAB&gt;&gt;
   
&lt;&lt;TAB&gt;&gt; &lt;/body&gt;&lt;/html&gt;
</pre>
would converted to
<pre>
&lt;html&gt; &lt;body&gt;
 &lt;h1&gt; T E S T &lt;/h1&gt; &lt;/body&gt;&lt;/html&gt;
</pre>

Mime
View raw message