I'm working with regex's using the RegEx.replace method and I'm running into some strings my patterns are not working for.
For strings such as:
"Av.Av. Italy"
"Av. Av. Italy"
"Av. . Av. Italy"
I'm trying to replace the Av's and remove all the extra periods and whitespaces so I tyr to use this regex
rgx = new Regex(@"(Av\.).(Av\.)");
address = rgx.Replace(address, replacement);
[edit] I want all of the above strings to end up just saying
"Av. Italy"
But it doesn't change anything.
I also wanted to use a regex to get random periods that appear on some strings (eg: "word . other word") with
rgx= new Regex(@"\b\.\b");
But that doesn't do anything either...
Am I using the escape sequences wrong?
Av. . Av. Italyshould end up like?