I have ant target that invokes replaceregexp task
<target name="regexp.replace"> <replaceregexp file="${file.temp}" ...
Using
<replaceregexp byline="true" flags="g" file="${someFIle}" match = "[\\]" ...