|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2005-12-06 11:15:04
Boris Kolpackov wrote:
> John,
>
> "John Maddock" <john_at_[hidden]> writes:
>
>
>>>Following the logic above it will match all single letters in the
>>>string,
>>>no?
>>
>>No, because of the trailing $.
>
>
> The original expression had trailing $ as well but it didn't help much,
> did it?
>
> So what's the verdict, is this a bug or a feature?
>
Feature. Perl has the same behavior:
$str = 'test.cidl';
$str =~ s/(\.(idl|cidl|cdl))?$/E.idl/g;
print "$str\n";
... prints:
testE.idlE.idl
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk