Suppose I have following code :
string input = "hello everyone, hullo anything";
string pattern = "h.llo [A-z]+";
string output = Regex.Replace(input,pattern,"world");
(I have tried to make it as simple as possible)
Above code output is "world, world"
while what I really want is a way to change all words following by h.llo
to world
and I want output to be "hello world, hullo world"
I was looking for a way to do this and I searched a lot and read this article:
Replace only some groups with Regex
But I didn't get much from it and I'm not sure it's exactly what I want.
Is there any approach at all?