This is a multi-part message in MIME format.

------extPart_000_021B_01C0ED75.20F00010
Content-Type: text/plain;
	charsetso-8859-1"
Content-Transfer-Encoding: quoted-printable

Is this normal?  It looks like $& ends up being a hungry match, but not the String#scan result.

irb> a = "aaa \"\\\"hello\\\"\"zzz"
"aaa \"\\\"hello\\\"\"zzz"
irb>regex = /"(\\"|[^"])*"/
/"(\\"|[^"])*"/
irb>
irb> a.scan(regex)
[["\\\""]]                 # this is strange result - $& is what I expected in some way in result
irb> print $&
"\"hello\""nil

Wayne

Wayne



------extPart_000_021B_01C0ED75.20F00010
Content-Type: text/html;
	charsetso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4611.1300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Is this normal?&nbsp; It looks like $&amp; ends up 
being a hungry match, but not the String#scan result.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>irb&gt; a = "aaa 
\"<A>\\\"hello\\\"\"zzz</A>"<BR>"aaa 
\"<A>\\\"hello\\\"\"zzz</A>"<BR>irb&gt;regex = /"(<A 
href='file://\\"|[^"])*"/'>\\"|[^"])*"/</A><BR>/"(<A 
href='file://\\"|[^"])*"/'>\\"|[^"])*"/</A><BR>irb&gt;<BR>irb&gt; 
a.scan(regex)<BR>[["<A>\\\</A>""]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# this is strange result - $&amp; is what I expected in some way in 
result<BR>irb&gt; print $&amp;<BR>"\"hello\""nil</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Wayne</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Wayne</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>

------extPart_000_021B_01C0ED75.20F00010--