ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dylan Farre <>
Subject How to replace a \ with &#x1a; Or how do I replace anything with &
Date Fri, 27 Feb 2009 18:30:23 GMT
I am trying to replace a \ with the character sequence &#x1a;
Don't ask why! Im not sure I know just yet.

If I use this method:

<replace file="${dir}\${file}"
token="\" value="&#x5c;" summary="true"> </replace>

it just replaces \ with \

If I use this method:

<replaceregexp file="${dir}\${file}" match="\" replace="&#x5c;"
byline="true"/> I get this error:
Unexpected internal error near index 1

If I try to build up the sequence with multiple replaces, Ant won't let me
insert an & into the file, I get this error:
The entity name must immediately follow the '&' in the entity reference.
"&#x1a" is an invalid XML character.

This is running ant on windows. Would the results be different from unix?

Would sed work from unix? what is the best sed-like app for windows?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message