I have a working solution however maintenance is frought with issues as every time I change a value I need to update many calls with the same change.
I make an SQL call and return one comma seperated string: SM,SEP,18,6,2021-09-16,2021-09-30,2021-09-30,3,273,Thu,272,2021-09-28,Tue,2021-08-28,2021240,2022,2021-09-15,2021-10-15,1900-01-01,,1900-01-01
I next go through and assign each of these values to a User Variable, in this case 21 variables and 21 calls
This regex works in the Set User Variable:
REGEX(MatchGetGroup|SM,SEP,18,6,2021-09-16,2021-09-30,2021-09-30,3,273,Thu,272,2021-09-28,Tue,2021-08-28,2021240,2022,2021-09-15,2021-10-15,1900-01-01,,1900-01-01|(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)|7)}
Result: Variable 'BW_PayCheckQtr' was updated to: 3
As you notice there are 21 groups, each represented by the (.*) and each has to have all the groups listed or it does not work correctly.
This regex also works to do the same thing but more simplified: (?:[^\,]*\,){7}(.*?)\, I also don't need to go back and change the previous set user variables when I add a new value to the string, it can be just replicated and the index (7) adjusted for each call. Much easier to maintain.
The new regex can be verified here:
https://regex101.com/r/0DpMBK/1 Most of my attempts to get this to run, I receive the whole regex in the output. However this one is the closest I can get but it returns the beginning of the whole string to the end of element 7: Variable 'BW_PayCheckQtr' was updated to: SM,SEP,18,6,2021-09-16,2021-09-30,2021-09-30,3,
{REGEX(Match|{TASK(cf8a79b6-9d6d-486d-9ad6-71b065353eeb|StdOut)}|(?:[^\,]*\,){7}(.*?)\,}
Any help would be appreciated.
Edited by user
2021-11-19T16:40:14Z
|
Reason: Not specified