javascript - Ant Regex Replace pattern with contents of file -


i'm trying figure out how replace matching text in files contents of file. want inline javascript sources html. loadfile doesn't work in replaceregexp.

<replaceregexp flags="gs">     <regexp pattern="\&lt;!--js--\&gt;(.*?)\&lt;!--/js--\&gt;"/>     <substitution expression='\&lt;script src="min.js"\&gt;\&lt;/script\&gt;'/>     <loadfile property="min.js" srcfile="compiled/min.js"/> </replaceregexp> 

here's example of using <replaceregexp> replace every <!--js-->***<!--/js--> contents of min.js.

<project name="ant-replaceregexp" default="run" basedir=".">     <target name="run">         <property name="js.pattern"             ><![cdata[[<]!--js--[>](.*?)[<]!--/js--[>]]]></property>          <loadfile property="min.js" srcfile="compiled/min.js"/>          <replaceregexp file="test.html" flags="gs">             <regexp pattern="${js.pattern}"/>             <substitution expression="${min.js}"/>         </replaceregexp>     </target> </project> 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -