Matchdata not returning the same data set as scan
<p>Given the following text:</p>

<pre><code>text = '&lt;w:body&gt;&lt;w:p
w14:paraId="56037BEC" w14:textId="3419ABF1" w:rsidR="001665B3"
w:rsidRDefault="008B4AC6"&gt;&lt;w:r&gt;&lt;w:t xml:space="preserve"&gt;This is the
story of a man who &lt;/w:t&gt;&lt;/w:r&gt;&lt;w:ins w:id="0" w:author="Mitchell Gou"
w:date="2016-09-28T09:15:00Z"&gt;&lt;w:r
w:rsidR="003566BF"&gt;&lt;w:t&gt;went&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:ins&gt;&lt;w:del w:id="1"
w:author="Mitchell Gou" w:date="2016-09-28T09:15:00Z"&gt;&lt;w:r
w:rsidDel="003566BF"&gt;&lt;w:delText&gt;goes&lt;/w:delText&gt;&lt;/w:r&gt;&lt;/w:del&gt;&lt;w:r&gt;&lt;w:t
xml:space="preserve"&gt; to the store to &lt;/w:t&gt;&lt;/w:r&gt;&lt;w:ins w:id="2"
w:author="Mitchell Gou" w:date="2016-09-28T09:15:00Z"&gt;&lt;w:r
w:rsidR="003566BF"&gt;&lt;w:t&gt;purchase&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:ins&gt;&lt;w:del w:id="3"
w:author="Mitchell Gou" w:date="2016-09-28T09:15:00Z"&gt;&lt;w:r
w:rsidDel="003566BF"&gt;&lt;w:delText&gt;buy&lt;/w:delText&gt;&lt;/w:r&gt;&lt;/w:del&gt;&lt;w:r&gt;&lt;w:t
xml:space="preserve"&gt; some milk.&lt;/w:t&gt;&lt;/w:r&gt;&lt;w:r w:rsidR="008C3761"&gt;&lt;w:t
xml:space="preserve"&gt; The was a &lt;/w:t&gt;&lt;/w:r&gt;&lt;w:ins w:id="4"
w:author="Mitchell Gou" w:date="2016-09-28T09:18:00Z"&gt;&lt;w:r
w:rsidR="008C3761"&gt;&lt;w:t&gt;replace&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:ins&gt;&lt;w:del w:id="5"
w:author="Mitchell Gou" w:date="2016-09-28T09:18:00Z"&gt;&lt;w:r
w:rsidR="008C3761"
w:rsidDel="008C3761"&gt;&lt;w:delText&gt;reason&lt;/w:delText&gt;&lt;/w:r&gt;&lt;/w:del&gt;&lt;w:r
w:rsidR="008C3761"&gt;&lt;w:t xml:space="preserve"&gt; to remove the milk that
was already inside the man’s house.&lt;/w:t&gt;&lt;/w:r&gt;&lt;w:r
w:rsidR="009D3E86"&gt;&lt;w:t xml:space="preserve"&gt; He wanted to
re&lt;/w:t&gt;&lt;/w:r&gt;&lt;w:ins w:id="6" w:author="Mitchell Gou"
w:date="2016-09-28T09:22:00Z"&gt;&lt;w:r
w:rsidR="009D3E86"&gt;&lt;w:t&gt;place&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:ins&gt;&lt;w:bookmarkStart
w:id="7" w:name="_GoBack"/&gt;&lt;w:bookmarkEnd w:id="7"/&gt;&lt;w:del w:id="8"
w:author="Mitchell Gou" w:date="2016-09-28T09:22:00Z"&gt;&lt;w:r
w:rsidR="009D3E86"
w:rsidDel="009D3E86"&gt;&lt;w:delText&gt;store&lt;/w:delText&gt;&lt;/w:r&gt;&lt;/w:del&gt;&lt;w:r
w:rsidR="009D3E86"&gt;&lt;w:t xml:space="preserve"&gt; the
milk.&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:p&gt;&lt;w:sectPr w:rsidR="001665B3"
w:rsidSect="00521CD0"&gt;&lt;w:pgSz w:w="11900" w:h="16840"/&gt;&lt;w:pgMar
w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708"
w:footer="708" w:gutter="0"/&gt;&lt;w:cols w:space="708"/&gt;&lt;w:docGrid
w:linePitch="360"/&gt;&lt;/w:sectPr&gt;&lt;/w:body&gt;'
</code></pre>

<p>And using the following regex:</p>

<pre><code>scan_result = text.scan(/&lt;w:ins.+?w:rsidR="([A-Z0-9]+)".+?&lt;w:t&gt;(\w+).+?w:rsidDel="([A-Z0-9]+)".+?&lt;w:delText&gt;(\w+)/m)
</code></pre>

<p>I get the following result:</p>

<pre><code>[["003566BF", "went", "003566BF", "goes"], ["003566BF", "purchase", "003566BF", "buy"], ["008C3761", "replace", "008C3761", "reason"], ["009D3E86", "place", "009D3E86", "store"]]
</code></pre>

<p>However using matchdata does not return the same data set:</p>

<pre><code>/&lt;w:ins.+?w:rsidR="(?&lt;sentence_id&gt;[A-Z0-9]+)".+?&lt;w:t&gt;(\w+).+?w:rsidDel="([A-Z0-9]+)".+?&lt;w:delText&gt;(\w+)/m.match(text)
</code></pre>

<p>returns:</p>

<pre><code>&lt;w:ins w:id="0" w:author="Mitchell Gould"
w:date="2016-09-28T09:15:00Z"&gt;&lt;w:r
w:rsidR="003566BF"&gt;&lt;w:t&gt;went&lt;/w:t&gt;&lt;/w:r&gt;&lt;/w:ins&gt;&lt;w:del w:id="1"
w:author="Mitchell Gould" w:date="2016-09-28T09:15:00Z"&gt;&lt;w:r
w:rsidDel="003566BF"&gt;&lt;w:delText&gt;goes
</code></pre>

<p>It does not seem to match all of the data. Why is this?</p>