What about this?

Implement your own extension of java.io.FilterReader
that counts the characters available from the Reader
passed to its constructor, and buffers the
decimal-formatted String representing the character
count to be returned from its read() method.  Then use
a filterchain something like:

<filterchain>
  <containsregex pattern="mypattern" replace="x"
flags="gs" />
  <filterreader
classname="my.package.CharacterCountingReader" />
</filterchain>

This may work; my apologies if someone else can come
up with a simpler way that doesn't involve scripting. 
;)

-Matt

--- Zsolt Koppany <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> how can I count the occurrences of a regular
> expression in a file with
> an ant task?
> 
> Zsolt
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to