title: Why do match and scan return different results for the same regex?
body: <p>I tried several options for matching in Ruby, and was confused by the results because <code>match</code> and <code>scan</code> return different results. This is an example:</p>
  
  <pre><code>s ="C:\Users\rdo\AppData\Local\Temp/ccqZSpeQ.o: In function `main':\r\nmain.c:(.text+0x8): undefined reference to `some_function'"
  
  %r[([\w\.\/]+):(.+)].match(s)
  # =&gt; #&lt;MatchData "C:Users\rdoAppDataLocalTemp/ccqZSpeQ.o: In function `main':\r" 1:"C" 2:"Users\rdoAppDataLocalTemp/ccqZSpeQ.o: In function `main':\r"&gt;
  
  s.scan(/([\w\.\/]+):(.+)/)
  # =&gt; [["C", "Users\rdoAppDataLocalTemp/ccqZSpeQ.o: In function `main':\r"], ["main.c", "(.text+0x8): undefined reference to `some_function'"]]
  </code></pre>
  
  <p>I expected that <code>match</code> would return a result like <code>scan</code> but it did not. Can anyone explain why?</p>