Need to replace all forward-slash (/) with > except for the ones in the square brackets
input string:
string str = "//div[1]/li/a[@href='https://www.facebook.com/']";
Tried pattern (did not work):
string regex = @"\/(?=$|[^]]+\||\[[^]]+\]\/)";
var pattern = Regex.Replace(str, regex, ">");
Expected Result:
">>div[1]>li>a[@href='https://www.facebook.com/']"