in reply to Matching optionally quoted string

Just use an XML parser. I recommend XML::LibXML. What you want to do then becomes
print $_->getAttribute( 'HREF' ), "\n\n" for XML::LibXML ->new() ->parse_fh( \*ASX ) ->findnodes( '//ref' )

Makeshifts last the longest.