forum

Home / DeveloperSection / Forums / Issue with Regex Replace

Issue with Regex Replace

Anonymous User 2255 27-Dec-2013

I am trying to replace every occurrence of "]}]" (ignore the quotes) using the Regex object in C#.

I have set up the Regex Escape value like this:

var regexReplaceVar = new Regex(Regex.Escape("]}]"));

I then call the replace method as shown below:

myEditedString = regexReplaceVar.Replace(startString, sringToInsert, 1);

It does not appear to be working the way I think it would. Are the characters I am attempting to replace special to Regular Expressions? Should they be modified to have them be taken as literals?

Thanks in advance.


c# c# 
Updated on 27-Dec-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By