I need to remove #!# instances from string when there's not # before or after the instance.
For example...
LoremImpsum#!#Dolor => matches #!#
Lorem #!#ASD## => matches #!#
Lorem #!## => no match
Lorem##!# => no match
my code so far:
foreach (Match match in Regex.Matches(formattedHtml, @"(?<!#)(#!#)(?!#)")
formattedHtml = formattedHtml.Replace(match.Value, "");
But it seems to me that negative lookahead or lookbehind wont work. Thanks.