Replace 使用属性替换变量中的字符串部分

Replace 使用属性替换变量中的字符串部分,replace,ant,Replace,Ant,嗨,伙计们, 我试图替换属性中的字符串的一部分,如下所示 <property file="build-local.properties" /> <-- <propertyregex property="destProperty" input="${sourceProperty}" regexp="${whatMatch}" replace="" global="true" /> 我们使用以下格式解决: <propertyregex property="

嗨,伙计们, 我试图替换属性中的字符串的一部分,如下所示

<property file="build-local.properties" /> <-- 


<propertyregex property="destProperty" input="${sourceProperty}" regexp="${whatMatch}" replace="" global="true" />

我们使用以下格式解决:

<propertyregex property="normalizedAppVersion" input="${appVersion}" regexp="${projectPrefix}\." replace="" casesensitive="false" />
直接在regexp属性值中。我不知道为什么,但如果不是,对我来说不起作用


谢谢,顺便问一下,
${sourceProperty}
${whatMatch}
的值是多少?
<propertyregex property="destProperty" input="${sourceProperty}" regexp="HARDCODED_STRING" replace="" global="true" />
<propertyregex property="normalizedAppVersion" input="${appVersion}" regexp="${projectPrefix}\." replace="" casesensitive="false" />
   # instead "MYPACKAGE." 
   projectPrefix="MYPACKAGE." 
   regexp="${projectPrefix}\."