My bad. had to put the replacement string in a block
When I use css.gsub(/(url\(['"]?)([^\)'"]+)(['"]?\))/) 
{"#{$1}#{$2.upcase}#{$3}"}

-- 
Posted via http://www.ruby-forum.com/.