ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Multiline regex matches
Date Tue, 17 Aug 2010 17:37:33 GMT
On 2010-08-17, Niklas Matthies wrote:

> I need to fail a build if a certain file doesn't match a certain
> multiline regex pattern. I tried somethink like

>     <fail>
>         <condition>
>             <resourcecount when="equal" count="0">
>                 <restrict>
>                     <fileset file="${file}"/>
>                     <containsregexp expression="${regex}"/>
>                 </restrict>
>             </resourcecount>
>         </condition>
>     </fail>

> but unfortunately containsregexp doesn't perform multiline matches.
> Specifying "(?m:${regex})" doesn't work.

[I've seen you've opened an enhanceent request for this, good.

> If the <matches> condition would support resources, I could use that,
> but it only supports the string attribute.

Since you are looking at a single file, you can use loadresource to read
it into a property and then use the matches condition.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message