You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Bill Milbratz <bm...@outstart.com> on 2009/01/23 18:22:36 UTC
howto?: copy file with filename match on regexp
Hi all,
Again, I have a well-defined problem which testing and searching has
yielded no fruit. Alas, I probably have missed something:
Problem:
I want to copy files with regexp selection based on a match in the
filename. For example, perform different copying alternatively
selecting/excluding the files whose 'basenames' start with decimals
(e.g. 77basic.css, 88neo.css).
Example data:
/path/to/my/skins/dir/basic.css
/path/to/my/skins/dir/77basic.css
/path/to/my/skins/dir/neo.css
/path/to/my/skins/dir/88neo.css
In testing and examining the source code, it looks like:
* The 'includes' attribute of the 'fileset' element does not do
regexp matching
* The 'containsRegexp' selector matches on the *contents* of the
file, not the name of the file.
Example regexps to match on file full-path name:
'does not begin with numeral':
.*/\D\w*.css
'does begin with numeral':
.*/\d++\w*.css
bill