Hi,

The following should work:

my $number = '0000000000000111';
my ($index) = ( $number =~ /\d+(\d{3})/ );

$index would contain the last three digits: '111'.

To learn about regular expressions in Perl, you can go through `perldoc 
perlre` and `perldoc perlretut`. The Perldoc website 
(http://perldoc.perl.org/) can be of help as well.

Regards,
Alan Haggai Alavi.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to