ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: regexp-type <mapper> doesn't work as expected/(advertised?)
Date Wed, 21 Oct 2009 06:33:54 GMT
On 2009-10-16, Francis GALIEGUE <> wrote:

> On Fri, Oct 16, 2009 at 06:20, Stefan Bodewig <> wrote:
> [...]

>>> Err, so what? A regex isn't supposed to match its whole input!

>> Not in general, but what I described is how the regex mapper works and
>> how it is documented to work.  The target file name is constructed from
>> the to pattern exclusively.  Any not-matched part of the file name or
>> any part not explicitly added to the target file name via group
>> references will be ignored.

>> This may not be what you expected, but it is how the mapper works.

> I then suggest that the documentation be reviewed to say that the
> regex must match all the filename.

This is not really true, it doesn't matter whether the match is all of
the file name or only part of it, the key is that the to attribute
provides the target file name and nothing else - in particular not parts
of the source file name that are not matched.

The documentation currently says

| If the source file name matches the from pattern, the target file name
| will be constructed from the to pattern, using \0 to \9 as
| back-references for the full match (\0) or the matches of the
| subexpressions in parentheses.

If you can come up with a clearer way to say what the target file name
is going to be, I'll happily change the wording.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message