ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: regexp recognition over a group of files
Date Fri, 15 Sep 2006 15:54:18 GMT
In Ant 1.6.5:

<property name="re.example" value="foo +.* +bar" />

<pathconvert property="matched">
  <path>
    <fileset dir="lookhere">
      <containsregexp expression="${re.example}" />
    </fileset>
  </path>
</pathconvert>
<echo>$${matched}=${matched}

In Ant 1.7 (please test our betas) you can simplify
the pathconvert/echo:

<pathconvert>
  <fileset dir="lookhere">
    <containsregexp expression="${re.example}" />
  </fileset>
</pathconvert>

-i.e., pathconvert w/o a property sends result to the
log; note also that the fileset can be specified
directly rather than having to be nested into a path.

HTH,
Matt

--- Michael Sorens <msorens@myrealbox.com> wrote:

> I am looking to do a task that is simple with the
> unix find command, but I cannot quite seem to grok
> all the pieces in ant to do it: I want to generate a
> list of files where the contents of each file
> contain--or do not contain, at my option--a
> particular string matching a regular expression. I
> would simply like to print a list of the resulting
> filenames on the console. Any suggestions?
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message