ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shindito <atanas.shin...@gmail.com>
Subject replaceregexp task
Date Wed, 30 Jun 2010 07:25:56 GMT

Hello, everyone, 
I want to replace a given pattern in a html file with some expression, I'm
using regexp. The problem is, that my script replaces only one expression
per line, in case of 2 expressions to be replaced on one line, it doesn't
work. 
Here is the target:

<target name="Regular expr example">
		<replaceregexp flags="g" byline="true">
			<fileset dir="${some folder}">
				<include name="**/*.html"/>
			</fileset>
			<regexp pattern="&lt;a href=&quot;./(\w+)/(.*).html&quot;&gt;" />
			<substitution expression="&lt;a href=&quot;./ \2.html&quot;&gt;" />
		</replaceregexp>
</target>

And here is a line from html, containing two matchs:

<td class="chart"> ./junit-count-chart.html Count /
./generated_reports/junit-rate-chart.html Rate </td>

I've set flags to g=global, but still not working. I've tryed all flags...
It only replaces the first regexp on the line.

Thanks for your help.

-- 
View this message in context: http://old.nabble.com/replaceregexp-task-tp29031606p29031606.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message