On Sat, 24 Mar 2001, Guy N. Hurst wrote:

> Result:
> 
> 
> File.foreach($config || "config.status") do |line| 
> 	if line =~ /^s%@(\w+)@%(.*)%g/
> 		unless %w(INSTALL DEFS configure_input srcdir).include? $1
> 			CONFIG[$1] = ($2||"").gsub(/\$\{([^{}]+)\}/, '$(\1)' )
> 		end
> 	end
> end


I don't think the $2||"" is actually needed:

str = "s%@blah@%%g"
re = /^s%@(\w+)@%(.*)%g/
(re.match str)[2]       # ==> ""


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav