# Note: the regex in the while(...) is overly simplistic - see text for discussion while ($Html =~ m{]+)>(.*?)}ig) { my $Guts = $1; # Save results from the match above, to their own . . . my $Link = $2; # . . . named variables, for clarity below. if ($Guts =~ m{ \b HREF # "href" attribute \s* = \s* # "=" may have whitespace on either side (?: # Value is . . . "([^"]*)" # double-quoted string, | # or . . . '([^']*)' # single-quoted string, | # or . . . ([^'">\s]+) # "other stuff" ) # }xi) { my $Url = $+; # Gives the highest-numbered actually-filled $1, $2, etc. print "$Url with link text: $Link\n"; } } ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl