Is there a way in ant to exclude certain files from a fileset using a regular expression?
containsregexp can be used to include files, but how do I exclude files matching a regex?
Is there a way in ant to exclude certain files from a fileset using a regular expression?
containsregexp can be used to include files, but how do I exclude files matching a regex?
 
    
    You're probably looking for the <not> selector container.  The Ant docs example
<fileset dir="." includes="*.txt">
    <containsregexp expression="[4-6]\.[0-9]"/>
</fileset>
could be negated thus:
<fileset dir="." includes="*.txt">
    <not>
        <containsregexp expression="[4-6]\.[0-9]"/>
    </not>
</fileset>
 
    
    In general you can use ! to prefix a regex pattern to invert the matching.
Here are some related discussion on inverted regex matching:
 
    
    