Ralf Hauser - 2004-07-14

Logged In: YES
user_id=266141

AW: ant find with regexp
From: Jan.Materne@rzf.fin-nrw.de
Sent: Wednesday, July 14, 2004 11:05 AM
To: hauser@acm.org
Subject: AW: ant find with regexp

dont know.
The work is done only in a one line:

public void execute() {
...
if (file.equals(filename) &&
!foundFiles.contains(includedFiles[i])) {
foundFiles.add(includedFiles[i]);
}
}

You have to
- provide the regexp (setter, member variable)
- use a regexp matcher for the comparison

Should be all. Because Ant has already some regexp
mechanisms well maybe find
some for reuse ... see inside
org\apache\tools\ant\util\regexp the RegexpUtil.java
sounds as a good resource ...

Jan

> -----Ursprngliche Nachricht-----
> Von: Ralf Hauser [mailto:ralfhauser@gmx.ch]
> Gesendet am: Mittwoch, 14. Juli 2004 10:58
> An: jan@materne.de
> Betreff: ant find with regexp
>
> Jan,
>
> As per bug
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24223, I
found
> your excellent "Tutorial: Tasks using Properties, Filesets
& Paths".
> How difficult would it be to extend this to require a
> regex'ed filename to
> be present somewhere?