title: Ruby regex search and replace array
body: <p>I've got an array with a list of image URLs that I'm trying to search/replace with a regex (via gsub). The values are in the format //subdomain.website.com/folder/image.extension. I want to add 'https' in front of each array entry.</p>
  
  <p>I've tried to use gsub, but the array remains unchanged:</p>
  
  <pre><code>matches = source.scan(/(\/\/\w+\.\w+\.\w{2,4}\/\w+\/\w+\.\w{2,4})/).uniq
  matches.each {|value| value.to_s.gsub!(/\/\//, 'https://')}
  </code></pre>
  
  <p>In Perl, I could do something like this to change each value:</p>
  
  <pre><code>for (@matches) {
      s/\/\//https:\/\//g;
  }
  </code></pre>
  
  <p>Am I calling the gsub function in an incorrect manner?</p>