J
Jeremy
I am trying to replace a string "P" with "\P" as long as the string "P" does
not already have a "\" in front.
for my search string I've used @"([^\\]P)" so my regex replace statement is:
System.Text.RegularExpressions.Regex pR = new
System.Text.RegularExpressions.Regex(@"([^\\]P)");
string strResult = pR.Replace(@"This is a XP test X\P", @"\P");
The poblem is that the statement replaces XP with \P where I want it to be
X\P. Can I do this with a regex statement?
not already have a "\" in front.
for my search string I've used @"([^\\]P)" so my regex replace statement is:
System.Text.RegularExpressions.Regex pR = new
System.Text.RegularExpressions.Regex(@"([^\\]P)");
string strResult = pR.Replace(@"This is a XP test X\P", @"\P");
The poblem is that the statement replaces XP with \P where I want it to be
X\P. Can I do this with a regex statement?