Reputation: 7521
I want to apply regexp find/replace on file with pure ant (for crossplatform)
Is it possible?
Upvotes: 3
Views: 226
Reputation: 420951
Yes, it is possible. It is well explained over here: Apache Ant - How to search a and replace regular expressions inside a text.
The article starts by quoting the documentation:
As reported by documentation, Ant provides a task,
<ReplaceRegExp>
, "for replacing the occurrence of a regular expression with a substitution pattern in a selected file or set of files".
and goes on to describe how you also do it for texts.
Upvotes: 3
Reputation: 8278
Yes. For example you can create java project that does the regexp magic, then export it to runnable jar and create the batch file or shell script that runs the jar. Finally in ant script you create a new target that runs the executable (batch\shell script)
Upvotes: 0