Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

Multiline regex matches

Niklas Matthies

2010-08-17

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

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.

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

Any other ideas?

-- Niklas Matthies

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.