Scoop
Scoop copied to clipboard
[Feature] A way to access `$Matches.Groups[uint].Captures[uint]` within `autoupdate`
Feature Request
Is your feature request related to a problem? Please describe.
Currently, when making capture groups, we can only access $Matches.Groups[uint].Value, sometimes you may need to access the actual Captures in each group, for example.
(foo){2}(bar)
So how do we access the foos? We can't. $Matches.Groups[1].Value is foofoo, and $Matches.Groups[2].Value is bar. We need $Matches.Groups[1].Captures[0] & $Matches.Groups[1].Captures[1]. The only thing you can actually do at the moment's copy-paste the regex again, and add named groups, that's not good.
Describe the solution you'd like
So this is the tough part. We'd want to use a character delimiter that can't appear in URIs to delimit the variable in the autoupdate.url, so maybe something like $match1\capture1 or $match1$capture1.
I did manage to get around this issue, by using single line mode and multiple groups
'(?s)your_pattern_here'
Maybe that helps
'(?s)your_pattern_here'
Doesn't work for me, I was already using multiple named groups to get around it. The point of the issue's not to have to do that, the Group data's already in memory, just needs to be accessed.
Doesn't work for me, I was already using multiple named groups to get around it. The point of the issue's not to have to do that, the
Groupdata's already in memory, just needs to be accessed.
Your not wrong 😅 Just posting here in you or some one else finds this useful. It defiantly would be much easier and intuitive the way you describe it and would have saved me a bunch of time trying to force a work around.