ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew van Renen" <>
Subject replaceregexp and backslashes
Date Thu, 05 Sep 2002 15:29:10 GMT
I want to use <replaceregexp> to update a configuration file in a standard 
'name=value' construct, where the value is a Windows path name, as in:


I further want to store the path name in a properties file (for obvious 

It all works fine, except that it appears I have to octuply(= x 8) my 
backslashes for the entry in my properties file, and quadruply the 
backslashes in my build file.  So this:



    <replaceregexp file="app.ini"

works but is rather unwieldy.

I realise that part of it is the whole business of escapes in Java and XML, 
but is there perhaps a way to either:

a. escape the whole string in one go (eg \'${App_Root_Dir}\schema.xml', or

b. do a scan/replace on the string to multiply the \s before submitting it 
to regexp

Any ideas out there?

Chat with friends online, try MSN Messenger:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message