Regex-Übereinstimmung zwischen bestimmten Tags
Posted: 16 Jan 2025, 11:39
Ich versuche, Abschnitte eines benutzerdefinierten HTML-Dokuments zu extrahieren und zu ersetzen oder zu entfernen.
Ich habe auf regex101.com herumgespielt und selbst damit experimentiert:
Code: Select all
stuff I want to keep
[i]@if includesDownloadables[/i]
This is some stuff I want to replace on a certain condition.
[i]@endif includesDownloadables[/i]
More stuff to keep
[i]@if instantDownload[/i]
More stuff that is conditional.
[i]@endif instantDownload[/i]
More stuff to keep
Code: Select all
string condition = "includesDownloadables";
string pattern = @"