[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
[MeasureString]
Measure=String
String=The color is red right now
[MeasureReplace]
Measure=String
String=[MeasureString]
DynamicVariables=1
RegExpSubstitute=1
Substitute="red":"blue"
[MeasureExtractRed]
Measure=String
String=[MeasureString]
DynamicVariables=1
RegExpSubstitute=1
Substitute=".*(red).*":"\1"
[MeasureExtractColor]
Measure=String
String=[MeasureString]
DynamicVariables=1
RegExpSubstitute=1
Substitute="The color is (.*) right now":"\1"
[MeasureReplace] will simply find any occurrence of "red" and replace it with "blue". You end up with:
The color is blue right now
[MeasureExtractRed] will find, but skip and throw away, anything other than "red", anything before or after it, and just return:
red
[MeasureExtractColor] will find the pattern "The color is ", then capture all characters until it sees " right now" and will return: