From: nobu.nokada@... Date: 2003-04-08T01:14:57+09:00 Subject: Re: a question about regexp Hi, At Tue, 8 Apr 2003 01:06:20 +0900, ts wrote: > B> Displaying $& in the inner loop of grep works fine, but when it enter my own > B> block, $& is put back to nil. Is there a way to keep the value of $& (and > B> all others $1...)? > > Well, $~ is a local, and thread local variable and perhaps in your case it > best to give this variable to the block, something like You can assign a MatchData to $~ and use $& and so on, but I don't recommend it. -- Nobu Nakada