I have tested the regex with kommodo rx toolkit and it seems everything ok, but when i use it in Links or in the komodo edbugger, i got no values for $1, $2 and so on.
sub {
my $tags = shift;
my $tmp = "http://www.sub.domaine.com/dirs/file";#$tags->{URL};
$tmp =~ m/^(http:\/\/) ( ([a-z0-9\-]+ [\.]) +?) ([a-z0-9\-]+ [\.]) ([a-z]+) (\/) (.*)/ ;
$tmp = "$1$2$4$5$6";
if ($7 !='') {
$tmp .= "...";
}
return $tmp;
}Has someone a clue, what´s wrong with it?
Code:
sub {
my $tags = shift;
my $tmp = "http://www.sub.domaine.com/dirs/file";#$tags->{URL};
$tmp =~ m/^(http:\/\/) ( ([a-z0-9\-]+ [\.]) +?) ([a-z0-9\-]+ [\.]) ([a-z]+) (\/) (.*)/ ;
$tmp = "$1$2$4$5$6";
if ($7 !='') {
$tmp .= "...";
}
return $tmp;
}