ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blaine Simpson <>
Subject Re: Replace target's problem
Date Fri, 21 Aug 2009 14:08:24 GMT
Khushwinder wrote:
> Hello All,
> ...
> <target name="rewrite-jsps">
>         <replace dir="${build.web.dir}" value="${buildNo}.js"
> casesensitive="true">
>             <include name="**/*.jsp"/>
>             <!-- string to replace -->
>             <replacetoken>.js</replacetoken>
>         </replace>
> </target>
> But it is also replacing the jsp file with build number because the
> replacetoken value is like .js. 
> I want that it should only replace .js files not the .jsp.
> Can anyone help me in this case.
> Thanks and rgds
I use the optional "replaceregexp" tag for this (instead of "replace"). 
If you aren't handy with regular expressions and don't have a reference
at hand, you can use .

I haven't used this in a while, so I checked build files where I've used
it, and I see that I typed the tag as "replaceregex" whereas the manual
calls it "replaceregexp".  I guess the proper name is "replaceregexp"
but that it recognizes the alternative spelling "replaceregex".

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message