I'm trying to replace a directory path string in a XML file using ANT with the value stored in variable ${param_value}.
In my example ${param_value} contains c:\mypath\mydir
In order to replace as wished, I use propertyregex.
The issue is that the regex replace value is c:mypathmydir
I don't understand why "replace" removes all backslashes.
When I echo to check the value of my variable before regex, it looks like:
<echo message="param_value out=${param_value}"/>
This echo returns c:\mypath\mydir
${param_token} is xml token (output)
<propertyregex property="param_temp"
input="${result}"
regexp="(<${param_token})>(.*|\\)*<(/${param_token}>)"
replace="\1>${param_value}<\3"
casesensitive="false"
defaultvalue="NotFound"/>
Thank you for your help.
0 comments:
Post a Comment