I need to replace a multi-line line in a file, for example:
startString bla bla bla ... endString
ant replaceregex. Ant code:
<copy file="${file}" tofile="${newFile}" overwrite="true"> <filterchain> <replaceregex pattern="startString(.+)endString" replace="zzz" flags="gmi" byline="true"/> </filterchain> </copy>
If the text to replace is a single line, everything works correctly, but when the text is multi-line, replaceregex does not work. What should I fix in my code?
source share