I'd like a regEx that can take a measure's output and transform it as follows.
If the output is 1) a single string, containing no commas - such as My PowerPlan - then return that very string.
If alternatively the string 2) does contain commas, then return all and only the text after the last comma. For instance, were the output to be (as it can be): @%SystemRoot%\system32\powrprof.dll,-13,High Performance then I wish the output to be High Performance.
Here is the relevant part of my code. At present, in case 2, it just returns the whole string.
Code: Select all
; ==== POWER PLAN ====
[measure_powerPlan_activeScheme]
DynamicVariables=1
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\ControlSet001\Control\Power\User\PowerSchemes
RegValue=ActivePowerScheme
UpdateDivider=#update_powerPlan_activeScheme#
[measure_powerPlan_activeScheme_name]
DynamicVariables=1
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\ControlSet001\Control\Power\User\PowerSchemes\[measure_powerPlan_activeScheme]
Code: Select all
; ==== POWER PLAN ====
[measure_powerPlan_activeScheme]
DynamicVariables=1
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\ControlSet001\Control\Power\User\PowerSchemes
RegValue=ActivePowerScheme
UpdateDivider=#update_powerPlan_activeScheme#
[measure_powerPlan_activeScheme_name]
DynamicVariables=1
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\ControlSet001\Control\Power\User\PowerSchemes\[measure_powerPlan_activeScheme]
RegValue=FriendlyName
UpdateDivider=#update_powerPlan_activeScheme_name#