Hey Andy, I take it all the values of $_ will contain "Universities Worldwide Search ", right?
Assuming that, if all you want to do is get the name of the country without that string and drop any possible numbers after it and the two possible extensions (.htm and .html), then this expression should do the trick:
my $string = 'Universities Worldwide Search Argentina2.htm';
$string =~ m/Universities Worldwide Search ([^0-9]*)\d*\.html?$/;
print $1;
Basically: match the part of the string following "...Search " which does not contain numbers, followed by zero or more numbers, followed by ".htm" followed by zero or one "l" and start matching at the end of the string.
Let me know if that works for you.
Assuming that, if all you want to do is get the name of the country without that string and drop any possible numbers after it and the two possible extensions (.htm and .html), then this expression should do the trick:
my $string = 'Universities Worldwide Search Argentina2.htm';
$string =~ m/Universities Worldwide Search ([^0-9]*)\d*\.html?$/;
print $1;
Basically: match the part of the string following "...Search " which does not contain numbers, followed by zero or more numbers, followed by ".htm" followed by zero or one "l" and start matching at the end of the string.
Let me know if that works for you.