Reputation: 318
I am using regex in a ant file to identify two kind of files:
. Files that finish with *.bin.zip . Files that finish with *[0-9].zip
I am using the or (|) condition to merge it but it is not working:
<fileset dir="${project.folder}/target/build">
<filename regex=".*[0-9].zip | .*bin.zip"/>
</fileset>
Someone can help me?
Upvotes: 0
Views: 108
Reputation: 17900
Try without the spaces:
<filename regex=".*[0-9].zip|.*.bin.zip"/>
Or better:
<filename regex=".*([0-9]|.bin).zip"/>
Upvotes: 3
Reputation: 72844
Remove the spaces in your regex; they are being counted in the pattern.
<fileset dir="${project.folder}/target/build">
<filename regex=".*[0-9].zip|.*bin.zip"/>
</fileset>
Upvotes: 2