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.#!/usr/bin/perl my $string="testing.123"; my $result = substr( $string, rindex( $string, '.' ) + 1 ); print "$result\n";
In reply to Help with a regex by marco.shaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |