To be equivalent to what was here before I think you should decode the url then run gsub on that - although based on the actual regex it probably won't make a difference
URI.decode(file_url).gsub(/.*\/(.*?$)/, '\1')