I am doing some string manupulations in my project. I am using the regex. replace method to replace the strings. But it replaces all occurances whereever the search string found.
Let us assume the input string as "ab abcd abcde" and search string as "ab" and the replace string as "XY".
If I use regex.replace("ab abcd abcde","ab","XY",RegexOptions.IgnoreCase), the output is found as below.
"XY XYcd XYcde"
But I am expecting the output as "XY abcd abcde". I mean the string should replace by using whole word search.
Can anyone help me on this.