ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Fix <jakob....@gmail.com>
Subject backslash escaping in a regex
Date Tue, 11 May 2010 09:19:33 GMT
Hi, looked through the archive, but I don't think pathconvert can be
used in this case.

property file:
prop=E:\\foo\\bar

build file:
<replaceregexp file="${target.dir}/foobar.xml">
  <regexp pattern="value=&quot;[^&quot;]+&quot;"/>
  <substitution expression="value=&quot;${prop}&quot;"/>
</replaceregexp>

actual result:
value="E:foobar"

desired result:
value="E:\foo\bar"

I also tried double escaping i.e.
prop=E:\\\\foo\\\\bar

but there all backslashes disappear as well.


thanks for pointers,
Jakob.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message