firasdib / Regex101

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

Non-capturing group still showing as matching group in "matching information" #1910

Closed rotorboy closed 1 year ago

rotorboy commented 1 year ago

Bug Description

Even though the group is set as a non-capturing group ie (?: xxxx), when the pattern inside parens matches, the group is shown as a "numeric" group in the "Matching Information" section.

Reproduction steps

Create a non-capturing group with a pattern, then enter a string that matches the pattern, and look in the matching information section

Expected Outcome

Ideally, the group would be labeled as a "non-capturing group", and most importantly, no NUMBER would be assigned, so only capturing groups would have numerics.

Browser

Include browser name and version Chrome 106.0.5249.51

OS

Include OS name and version Mac OS 12.4

working-name commented 1 year ago

Hello! Do you happen to have a link? I can't seem to reproduce it or I don't get what you mean.

rotorboy commented 1 year ago

Alan;

Thanks for getting back to me

https://regex101.com/r/w6xCjY/1 https://regex101.com/r/w6xCjY/1

As shown (?:d | e) is a non-capturing group, yet in the "match information” area, it is shown as “group 1”; it should be labelled “un-captured group” or something other than numeric “1”.

Thanks

-Avi

On Sep 26, 2022, at 4:08 PM, Alan @.***> wrote:

Hello! Do you happen to have a link? I can't seem to reproduce it https://regex101.com/r/zrr8v5/1 or I don't get what you mean.

— Reply to this email directly, view it on GitHub https://github.com/firasdib/Regex101/issues/1910#issuecomment-1258015217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJ4HKFICLU4ZUMFSHYG4YDWAGN5FANCNFSM6AAAAAAQVWP5O4. You are receiving this because you authored the thread.

working-name commented 1 year ago

Gotcha, that is probably an older link/regex because it has (?:(d|e)) which is a capture group within a non-capturing group. Otherwise it seems you're using PCRE2 and the default flags which is what I was testing with as well.

rotorboy commented 1 year ago

I JUST made that link so not sure how it can be older, but indeed you are correct; that IS a caption group; not sure how I missed that.

-Avi

On Sep 26, 2022, at 16:54, Alan @.***> wrote:

 Gotcha, that is probably an older link because it has (?:(d|e)) which is a capture group within a non-capturing group. Otherwise it seems you're using PCRE2 and the default flags which is what I was testing with as well.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.