How can I use Xcode's `Find and Replace` on Multiline blocks of text
<p>I have a large file with hundreds of blocks of text (parts of C++ method calls) that resemble the <code>Current</code> block below and I wish to use <strong>Xcode’s Regular Expression replacement</strong> to change each one to resemble the <code>Desired</code> block below, capturing values 0.89f, A name, 0.1, 0.5 and 2.</p>

<p><a href="https://i.stack.imgur.com/rPokD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rPokD.png" alt="Current Block"></a></p>

<p><a href="https://i.stack.imgur.com/JcXpi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JcXpi.png" alt="Desired Block"></a></p>

<p>Note that both blocks start and end with <code>new Zapp</code> and <code>//d.p.’s to show</code> respectively so to save myself loads of manual editing I wish to use regex search and replace.</p>

<p>The main problem I face is the <code>multi-line</code> nature of the blocks.  If we ignore that for a moment, I have ALMOST performed a search and replace on the following <code>single-line</code> blocks:</p>

<p>Current:</p>

<p><a href="https://i.stack.imgur.com/p5v7I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p5v7I.png" alt="Current Single-Line"></a></p>

<p><code>new Zapp (0.89f  // defaultParameterValue , "A name" // name , 0.1     // min , 0.5 // max , 2    // d.p.'s to show</code></p>

<p>Desired:</p>

<p><a href="https://i.stack.imgur.com/nu6A1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nu6A1.png" alt="Desired Single-Line"></a></p>

<p><code>new Zapp  (NormalisableRange&lt;float&gt; (0.1, 0.5) ,NormalisableRange&lt;float&gt; (0.1, 0.5).convertTo0to1(0.89f) , "A name"     // name  , 2        // d.p.'s to show</code></p>

<p><strong>The Find and Replace:</strong></p>

<p><strong>Find</strong>: <code>Zapp\s+\((.*)\s+// defaultParameterValue\s+,\s+"(.*)"\s+\/\/\s+name\s+,\s+(.*)\s+\/\/\s+min\s+,\s+(.*)\s+\/\/\s+max\s+,\s+(.*)\s+\/\/\s+d.p.'s</code></p>

<p><strong>Replace</strong>: <code>Zapp  (NormalisableRange&lt;float&gt; ($3, $4) ,NormalisableRange&lt;float&gt; ($3, $4).convertTo0to1($1) , "$2"     // name  , $5        // d.p.’s</code></p>

<p>This <strong>single-line</strong> solution has the problem that additional white-space is seen after capture 1 (1 space), capture 3 (4 spaces) and capture 5 (3 spaces), otherwise it works well:</p>

<p><a href="https://i.stack.imgur.com/1nS22.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1nS22.png" alt="Comparison of Search and Replace output and ideal output "></a></p>

<p>I tried to eliminate the whitespace from capture 1 (0.89f), capture 3 (0.1) and capture 5 (2) using <code>[^\s]+</code> but it didn't help so if anybody can point out the reason for that I'd be grateful. </p>

<p><a href="https://i.stack.imgur.com/IC7l5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IC7l5.png" alt="enter image description here"></a></p>

<p>I can, for what it's worth, search for <code>upper</code> and <code>lower</code> using <code>\s+</code> but I can't put it all together to achieve the desired result.  </p>

<p>I've seen some old posts online that suggest this task might not be possible with Xcode.  If that is true, can anybody suggest an alternative approach that will get the job done?</p>