Hello,
I have a rather strange issue while replacing strings from a
set of files. My objective is to replace occurences of :
../http://web1.foo.com with http://web1.foo.com
../../http://web1.foo.com with http://web1.foo.com
../../../http://web1.foo.com with http://web1.foo.com
and so on.
The ideal thing of course is to use a regex. i.e (../)* I did :
<copy todir="${docroot}${release-version}/ct-html">
<fileset dir="${deployroot}/ct-html/branches/${release-branch}">
<include name="**/*.*"/>
</fileset>
<filterchain>
<replaceregex pattern="../http" replace="http" flags="gi"/>
</filterchain>
</copy>
This works in replacing ../html by html without problems. However when I do :
<copy todir="${docroot}${release-version}/ct-html">
<fileset dir="${deployroot}/ct-html/branches/${release-branch}">
<include name="**/*.*"/>
</fileset>
<filterchain>
<replaceregex pattern="(../)*http" replace="http" flags="gi"/>
</filterchain>
</copy>
This fails.
If i do :
<copy todir="${docroot}${release-version}/ct-html">
<fileset dir="${deployroot}/ct-html/branches/${release-branch}">
<include name="**/*.*"/>
</fileset>
<filterchain>
<replaceregex pattern="(../)*http" replace="http" flags="gi"/>
</filterchain>
<filterchain>
<replaceregex pattern="../http" replace="http" flags="gi"/>
</filterchain>
</copy>
This replaces the ../html by http but the ../../html ../../../html get
left out. The logical conclusion is my regex is wrong. i tried ^(../)*
but that does not help either.
Any suggestions?
Regards,
- vihan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]