Using the following regex
<w:p.*?\$\{test\}.*?\/w:p>
I'm trying to match the first
<w:p>
before the "${test}" and the first
</w:p>
after. The after worked just fine, using the ? quantifier, but it refuses to stop at the first
<w:body><w:p w:rsidRDefault="00271ADB"/><w:p w:rsidR="00C15291"><w:pPr><w:p w:rsidR="0093632F" w:rsidRDefault="0093632F"><w:pPr><w:rPr></w:rPr></w:pPr><w:r><w:rPr></w:rPr><w:br/><w:t>${test}</w:t></w:r></w:p></w:body>
This is what I expected the result to be:
<w:p w:rsidR="0093632F" w:rsidRDefault="0093632F"><w:pPr><w:rPr></w:rPr></w:pPr><w:r><w:rPr></w:rPr><w:br/><w:t>${test}</w:t></w:r></w:p>
but instead this is what being returned
<w:p w:rsidRDefault="00271ADB"/><w:p w:rsidR="00C15291"><w:pPr><w:p w:rsidR="0093632F" w:rsidRDefault="0093632F"><w:pPr><w:rPr></w:rPr></w:pPr><w:r><w:rPr></w:rPr><w:br/><w:t>${test}</w:t></w:r></w:p>
This is the result in the editor: https://i.sstatic.net/4ri4C.png
And this is the result I'm expecting: https://i.sstatic.net/W87K9.png