To replace a word or character with Ant,
we can use the following command.
But the above command can use to replace words withouth xml/html reserved characters only.
To replace words with xml/html reserved characters,
Steps:
1. encode the xml/html reserved words before putting into the the <replaceregexp /> command.
eg, <a>link</link> => <a>link</a>
2. put the encoded words into <replaceregexp />
eg,
Done!!
we can use the following command.
<replaceregexp file="{FILE_TO_REPLACE}"
match="{WORD_TO_REPLACE}"
replace="{WORD}" flags="g" byline="true" />
But the above command can use to replace words withouth xml/html reserved characters only.
To replace words with xml/html reserved characters,
Steps:
1. encode the xml/html reserved words before putting into the the <replaceregexp /> command.
eg, <a>link</link> => <a>link</a>
2. put the encoded words into <replaceregexp />
eg,
<replaceregexp file="{FILE_TO_REPLACE}"
match="<a>link</a>"
replace="<a>new_link</a>" flags="g" byline="true" />
Done!!