<在Ant contrib propertyregex中

时间:2016-04-12 17:23:03

标签: regex ant ant-contrib

我想替换属性值中的<

<propertyregex property="db.exec.schema.key" input="${db.exec.schema.key}" regexp="<" replace="/" global="true" />

导致属性&#34; regexp&#34;的值与元素类型相关联&#34; propertyregex&#34;不得包含&#39;&lt;&#39;字符

当我用反斜杠逃避它时,当我尝试&lt;时,它不匹配。

知道如何用Ant替换<吗?

1 个答案:

答案 0 :(得分:1)

尝试使用&lt;来逃避<。其他实体引用也是如此:

>   &gt;
"   &quot;
&   &amp;
'   &apos;