Regex issues in Node

I have been trying to use Regex to select a block of an XML based .NET Core CSPROJ file, and yes before you say know I could use XPATH, but why am not is another story.

I was trying to use the Regex

1content.match(/<PropertyGroup>((.|n)\*)</PropertyGroup>/gmi)

The strange thing was this selection string worked in online Regex testers and in online Javascript IDEs, but failed inside my Node based Azure DevOps Pipeline extension.

After much experimentation I found that the following line worked

1content.match(/<PropertyGroup>(\[sS\]\*?)</PropertyGroup>/gmi)
2
3  

Well that a a good few hours of my life I won’t get back. No idea why Node handles the wildcards differently