how to replace a backslash in some lines of a text in Ant
问题 Using <replaceregexp byline="true" flags="g" file="${someFIle}" match = "[\\]" replace = "/"/> I can easily replace all the \ with /. But Suppose the text is: Other A\B\C Some C\D\E Other ... Other ... ... How to replace the "\" with "/" in the second line which has prefix "Some", but not other lines: Other A\B\C Some C/D/E ... 回答1: replaceregexp does not have options to skip lines. 回答2: Your problem cannot be merely solved by a single regex. You need to do something more complex. 1) Read