Click to See Complete Forum and Search --> : perl code question


abcdef1
February 10th, 2011, 06:11 AM
Hi,

I have below code :

my($abc) = "fred<hello>3hello";
$abc =~ /^[^\d]{2,4}<([^>]+)>\d?\1$/;

if (defined($1)) {
print "$1\n";
} else {
print "not found\n";

}
}


What is the code doing ?? what function of the regular expression

$abc =~ /^[^\d]{2,4}<([^>]+)>\d?\1$/;

Please advice what it do ??