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
Compiled & source-generated Regex throw IndexOutOfRangeException on a nested optional containing a lazy capturing loop #129511
A pattern combining an outer optional group wrapping an inner optional capturing group followed by a lazily-quantified capturing loop and a trailing literal throws System.IndexOutOfRangeException during matching under both RegexOptions.Compiled and the [GeneratedRegex] source generator. The interpreter matches the same input correctly (empty successful match).
Note: similar to #126556, but a different defect — it still reproduces on 11.0.0-preview.5.26302.115, which already contains the #126556 fix (PR #126561).
All three engines should agree (interpreter returns a successful empty match). Instead Compiled and [GeneratedRegex] throw IndexOutOfRangeException in TryMatchAtCurrentPosition.
Actual behavior
Compiled and [GeneratedRegex] throw IndexOutOfRangeException in TryMatchAtCurrentPosition.
Activity
dotnet-policy-service commentedon Jun 17, 2026
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.
Fix compiled/source-generated lazy loop stack unwinding when giving u…
Fix compiled/source-generated lazy loop stack unwinding when giving u…