Bug 56845 - Enhancement to ReplaceRegExp - suppport mutliple nested regexp
Summary: Enhancement to ReplaceRegExp - suppport mutliple nested regexp
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-13 09:51 UTC by icoulter
Modified: 2014-08-13 09:51 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description icoulter 2014-08-13 09:51:18 UTC
Could the regexp task be extended to support multiple regexp and substitution 

For example something like this:

<replaceregexp file="test.txt">
  <regex>
     <regexp pattern="OldProperty=(.*)"/>
     <substitution expression="NewProperty=\1"/>
  </regex>
  <regex>
     <regexp pattern="UserName=Fred"/>
     <substitution expression="UserName=Joe"/>
  </regex>
</replaceregexp>


Main reason for this is due to Bug 34633.  Have seen scenario where I call replaceregexp  on same file multiple times, the first replace works but randomly the subsequent calls fail. Doing all the regexp in one task with one final file move from temp folder back to original might solve this?