I’m trying to understand why the following regular expression does not do what I expect in Powershell.
["(Total|Group1|Group2)",(d+),d*,,,,,d+,d+]
I would expect this to return nine matches as there are three groupings that match this expression, each with two tokens. Regex101 gives me the results I expect (see here), but Powershell only returns the first matching group (three matches).
Name Value
---- -----
2 47
1 Total
0 ["Total",47,,,,,,1,2]
It’s easy enough to split this into three separate expressions and process them one at a time. That just feels unnecessary.
Test string:
<script type="text/javascript">
var resourceFolder = "Test_Results_20240621_0910";
var blockSize = 50000;
block0 = [["Total",47,,,,,,1,2],["Group1",29,0,,,,,3,5],["Group2",52,0,,,,,8,4]];
coverageData = [block0];
</script>