Eclectic-tech already described how to do this right from the WebParser regex pattern, but you can do it afterwards as well, using your original code, via substitutes, e.g.:
Code: Select all
[MeasureWinning]
Measure=WebParser
URL=file://#CURRENTPATH#data.json
RegExp=(?siU)Winnings":"(.*)".*WinningNumbers":"(.*)"
FinishAction=[!UpdateMeasure *][!UpdateMeter *][!Redraw]
[WinningNumbers]
Measure=WebParser
URL=[MeasureWinning]
StringIndex=2
[WinningNumber1]
Measure=String
String=[WinningNumbers]
RegExpSubstitute=1
Substitute="(?U)^(.+),(.+),(.+),(.+),(.+),(.+),(.+)$":"\1"
DynamicVariables=1
[WinningNumber2]
Measure=String
String=[WinningNumbers]
RegExpSubstitute=1
Substitute="(?U)^(.+),(.+),(.+),(.+),(.+),(.+),(.+)$":"\2"
DynamicVariables=1
[WinningNumber3]
Measure=String
String=[WinningNumbers]
RegExpSubstitute=1
Substitute="(?U)^(.+),(.+),(.+),(.+),(.+),(.+),(.+)$":"\3"
DynamicVariables=1
[WinningNumber4]
Measure=String
String=[WinningNumbers]
RegExpSubstitute=1
Substitute="(?U)^(.+),(.+),(.+),(.+),(.+),(.+),(.+)$":"\4"
DynamicVariables=1
[WinningNumber5]
Measure=String
String=[WinningNumbers]
RegExpSubstitute=1
Substitute="(?U)^(.+),(.+),(.+),(.+),(.+),(.+),(.+)$":"\5"
DynamicVariables=1
[WinningNumber6]
Measure=String
String=[WinningNumbers]
RegExpSubstitute=1
Substitute="(?U)^(.+),(.+),(.+),(.+),(.+),(.+),(.+)$":"\6"
DynamicVariables=1
[WinningNumber7]
Measure=String
String=[WinningNumbers]
RegExpSubstitute=1
Substitute="(?U)^(.+),(.+),(.+),(.+),(.+),(.+),(.+)$":"\7"
DynamicVariables=1
[Meter1]
Y=0
SolidColor=0,0,0,1
Meter=String
MeasureName=WinningNumber1
Text=%1
[Meter2]
Y=0R
SolidColor=0,0,0,1
Meter=String
MeasureName=WinningNumber2
Text=%1
[Meter3]
Y=0R
SolidColor=0,0,0,1
Meter=String
MeasureName=WinningNumber3
Text=%1
[Meter4]
Y=0R
SolidColor=0,0,0,1
Meter=String
MeasureName=WinningNumber4
Text=%1
[Meter5]
Y=0R
SolidColor=0,0,0,1
Meter=String
MeasureName=WinningNumber5
Text=%1
[Meter6]
Y=0R
SolidColor=0,0,0,1
Meter=String
MeasureName=WinningNumber6
Text=%1
[Meter7]
Y=0R
SolidColor=0,0,0,1
Meter=String
MeasureName=WinningNumber7
Text=%1
The (?U) stands for ungreedy matching, aka match as few chars as possible. I used + instead of * in the substitutes to avoid Rainmeter giving back the literal \N when that capture is empty. Didn't account for spaces since by default, String meters trim leading and trailing spaces in the Text option, but you can easily account for them in the substitutes, if desired.
Notice that, for this to work, you have to update the relevant String measures / meters and redraw the skin in the FinishAction from the main WebParser (I used * aka all of the same kind, for simplicity), so that data retrieval triggers the extraction of such numbers from the aggregate string.
P.S. Neither the variant from eclectic-tech nor mine account for the (unlikely, but still) possibility that the winning numbers part from the site is something else, e.g. less than 7 numbers, empty, or containing some other message if data is not available, so typically you'll have to use (?(?=<patterntofind>)<patterntomatch>) lookahead assertions if that's the case.