got a html which contains 2 lines of texts.
<!-- START -->
asdf
<!-- END -->
between those 2 marker can stand anything and its changing data so its not same data all the time. Is there a possibility to erase all lines between those 2?
Have tried with regex
(?sm)<!-- START -->.*?(?=^<!-- END -->)
but he always starts with the first line and not below.
Can someone help me to start after with regex and then delete it?
html agility pack.(?=^<!-- END -->)You could try a capturing group and use the group in the replacement(?sm)<!-- START -->\r?\n(.*?)\r?\n<!-- END -->regex101.com/r/CGun4i/1 but html and regex is usually not a good combination.$regex=@' (?ms)^(\s*<!-- OPC-ITEM-ENTRIES START -->\s*?\r?\n).*?\r?\n(\s*<!-- OPC-ITEM-ENTRIES END -->\s*) '@ $delete = (Get-Content -raw $file) -replace $regex, '$1$2' $delete |Set-Content C:\Users\marku\Desktop\GEA\Powershell\mdi-opc-items.html