I have a standard .Net .csproj xml file that contains xml tags and text between them like this:
<lorem>ipsum</lorem>
<PackageReleaseNotes>Some information.
- Some more information.</PackageReleaseNotes>
<lorem>ipsum</lorem>
I need a bash command that will extract the text, newlines and all, between the <PackageReleaseNotes>
and </PackageReleaseNotes>
tags.
I came up with cat Useful.String.Extensions.csproj | grep -o -P '(?<=PackageReleaseNotes>).*(?=</PackageReleaseNotes>)'
and it works if the text between the tags does not have newlines. But for the case I used as an example, it returns nothing.