Hi --

On Tue, 27 Feb 2001, Joseph McDonald wrote:

> 
> Is there a shortcut like:
> if ((command) = part =~ /#{@pre}\s*(.*?)\s*#{@post}$/s) 
> 	puts "command: #{command}"
> end
> 
> instead of:
> 
> if (part =~ /#{@pre}\s*(.*?)\s*#{@post}$/s) 
> 	command = $1
> 	puts "command: #{command}"
> end

Try this:

command = /#{@pre}\s*(.*?)\s*#{@post}$/s.match(part)[1]
puts "command: #{command}" if command


David

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