 <p>From more exchange it turns out that some detail of the redundant specifications caused a mismatch.</p> <p>Tray the following replacement. It will work:</p> <pre><code>preg_match('#MonetaryCode"&gt;USD.*MonetaryBuy"&gt;([0-9,.]*)&lt;.*MonetarySell"&gt;([0-9,.]*)&lt;#Uis', $content, $USDmatch); preg_match('#MonetaryCode"&gt;EUR.*MonetaryBuy"&gt;([0-9,.]*)&lt;.*MonetarySell"&gt;([0-9,.]*)&lt;#Uis', $content, $EURmatch); preg_match('#MonetaryCode"&gt;GBP.*MonetaryBuy"&gt;([0-9,.]*)&lt;.*MonetarySell"&gt;([0-9,.]*)&lt;#Uis', $content, $GBPmatch); $eur = $EURmatch[2]; $usd = $USDmatch[2]; $gbp = $GBPmatch[2]; </code></pre> <p>I just shortened the regexp and eliminated unnecessary groupings. The remarks about greedyness and linebreaks have all been illguided. You already had the proper modifiers thatt I just overlooked in the long rexep pattern strings. Sorry for the confusion.</p>