firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.21k stars 198 forks source link

.NET balancing groups: Incorrect Unit Test captured text results #2018

Closed OnlineCop closed 1 year ago

OnlineCop commented 1 year ago

Bug Description

Unit tests are passing that shouldn't, when values are pushed onto (and popped off of) the balancing group (.NET) stacks.

Specifically, any test using assert that capture group 1... reports success, even when the case should fail.

Reproduction steps

Unit tests under https://regex101.com/r/gtXPSK/1.

Expected Outcome

Unit tests which assert any kind of values for capture group 1 in .NET should take into consideration that its group may have more than one value stored within the group's stack: assert that capture group [1.1]..., assert that capture group [1.2]..., etc.

firasdib commented 1 year ago

This is fixed in the upcoming release.

You can't target specific captures, when you select a capture group, all captures will be checked.