http://qs1969.pair.com?node_id=637656

marco.shaw has asked for the wisdom of the Perl Monks concerning the following question:

#!/usr/bin/perl my $string="testing.123"; my $result = substr( $string, rindex( $string, '.' ) + 1 ); print "$result\n";
Using this, if $string doesn't have ".123" in it, I get the whole string output, but I don't want that. I just want the string output *if* it has ".123" at the end. I guess what I'm looking for is a test as to whether there's a ".0-9*" expression at the end. I need a ".", then any number of numerical values, but at least one. The "." has to be at the end.