Dear Devs,
the following code is used:
'''
[TestClass]
public class DebugTests
{
[TestMethod]
public void OneSpaceStringTest()
{
var oneSpaceString = Regex.Replace("x x", "[ ]{2,}", " ");
Assert.AreEqual("x x", oneSpaceString);
}
}
'''
one would expect to get "x x" but returns in the FULL framework "xx" instead.
.NET Core returns the correct string.
Expectation is based on the test i did with RegexR
Martijn
How can folks repro this? I just ran Regex.Replace("x x", "[ ]{2,}", " ") on .NET Framework 4.7.2 and got "x x" as a result.
The server was running 4.7.1 and not 4.7.2
@jnm2 4.7.2 runs like a sharm. Thanks
Most helpful comment
How can folks repro this? I just ran
Regex.Replace("x x", "[ ]{2,}", " ")on .NET Framework 4.7.2 and got"x x"as a result.