#!/usr/bin/perl -n00
while ( m{          # match repeatedly with /g
	< \s* A     # this is an anchor
	  \s+ HREF  # a link spec
	  \s* = \s* # here comes the link
	  ( ["'] )  # either quote, saved in $1
	            # and \1
	  ( .*? )   # the whole link, saved in $2
	  \1        # the original $1 quote
	  .*? >     # the rest of the tag
	  }xsgi)    # /x for expanded patterns
      		    # /s so . can match \n
		    # /g to get multiple hits 
		    #    in one paragraph
		    # /i for case insensitivity
		    #    on A and HREF
{
   print "$2\n";
}

