You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG? Compiled RegularExpression throws exception incorrectly when leaving Balancing Groups #111631
Using new Regex("(.)(?'2-1'(?'-1'.))", RegexOptions.Compiled).Matches("wtf") will throw an exception "Index was outside the bounds of the array".
Reproduction Steps
using System;
using System.Text.RegularExpressions;
var pattern = @"(.)(?'2-1'(?'-1'.))";
var input = @"11";
try
{
Match matchCompiled = new Regex(pattern, RegexOptions.Compiled).Match(input);
Console.WriteLine($"Compiled: {matchCompiled.Success}");
}catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
Activity
dotnet-policy-service commentedon Jan 20, 2025
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.
stephentoub commentedon Jan 23, 2025
Thanks. Will be fixed by #111769.
Specified argument was out of the range of valid values.in compiled mode #119444 as a duplicate of this issue