Hello,
You have:
my $rcs = '$Revision: 1.47 $'; # $version was a typo I believe
$rcs =~ s/[^\d.]+//;
The substitution matches the first sequence of non-digits and non-dots
and replaces it with "" (nothing). So, it matches 'Revision: ' and you
have $rcs = '1.47 $'. You need to use the 'g' modifier to replace all
occurences of that sequence.
$rcs =~ s/[^\d.]+//g;
Hope this helps,,,
Aziz,,,
In article <[EMAIL PROTECTED]>,
"charles" <[EMAIL PROTECTED]> wrote:
> my $version = '$Revision: 1.47 $';
> $rcs =~ s/[^\d.]+//;
>
> looking at the regex match, i would think this should match all
> non-numeric and \. characters. however, the value of $rcs ends up as:
>
> 1.47 $
>
> i am not sure why the \s and \$ after the numbers are not being wiped
> out.
>
> thanks -c
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]