喜欢在:
<replace file="${src}/index.html" token="</copyright>beginning text*end text<copyright>" value="wombat"/>
其中&#34;&lt; / copyright&gt;开头文字*结束文字&lt; copyright&gt;&#34;是某种字符串,我不知道它的中间内容。
我有一种情况,我不能100%确定我想要替换的文本每次都是相同的。
答案 0 :(得分:2)
如果要匹配模式,请使用replaceregexp
任务。请参阅https://ant.apache.org/manual/Tasks/replaceregexp.html。
它具有几乎相同的用法语法,但接受正则表达式作为匹配字符串。