【发布时间】:2018-05-16 11:19:26
【问题描述】:
如何使用正则表达式组从 dataweave 1.0 中的字符串中提取数据?
%var sampleString="3,2,0"
{
"groups":using(regexMatch= sampleString scan /^(?<grp1>\d{1}),(?<grp2>\d{1}),(?<grp3>\d{1})$/) {
"group1": regexMatch["grp1"] ????? Any way to get the grp1 value by group name,
"group2": regexMatch[0][2] //works,
"group3": regexMatch[0][3] //works
}
}
【问题讨论】: