My regex will not work if applied to a multiline xml schema : <p>I've written a regex to alter some XML nodes - taking a generic node name and replacing it instead with the nodes attribute value like so:
Regex</p>

<pre><code>&lt;custom-attribute attribute-id="(.*)?"\s*(&gt;*)(.*?)&lt;/custom-attribute&gt;
</code></pre>

<p>for the following xml:</p>

<pre><code>&lt;custom-attribute attribute-id="isNewtest"&gt;false&lt;/custom-attribute&gt;
</code></pre>

<p>using replace regex</p>

<pre><code>&lt;$1&gt;$3&lt;/$1&gt;
</code></pre>

<p>gives output of</p>

<pre><code>&lt;isNewtest&gt;false&lt;/isNewtest&gt;
</code></pre>

<p>which is what I am looking for - however - once more than one node is introduced into the schema - e.g</p>

<pre><code>&lt;custom-attribute attribute-id="isNewtest"&gt;false&lt;/custom-attribute&gt;
&lt;custom-attribute attribute-id="isAnotherNewtest"&gt;false&lt;/custom-attribute&gt;
</code></pre>

<p>and I run the regex, the output is:</p>

<pre><code>&lt;isNewtest"&gt;false&lt;/custom-attribute&gt;
&lt;custom-attribute attribute-id="isAnotherNewtest&gt;false&lt;/isNewtest"&gt;false&lt;/custom-attribute&gt;
&lt;custom-attribute attribute-id="isAnotherNewtest&gt;
</code></pre>

<p>which is not what I was expecting, I was hoping for:</p>

<pre><code>&lt;isNewtest&gt;false&lt;/isNewtest&gt;
&lt;isAnotherNewtest&gt;false&lt;/isAnotherNewtest&gt;
</code></pre>

<p>I'm obviously missing something to do with searching through more than one node at a time or multiline selector? - Can someone point me in the right direction please? I've got to restructure a 20,000 line xml doc and not relishing the idea of doing it manually line by line..</p>
