0

当我尝试直接在模式 /2020-04-01,ARS,AED/ 中传递值时,但是当我尝试传递变量时,我没有得到输出

$temp1:=ExecutionDate;
$temp2:=Currency;
$temp3:=ConvertToCurrencyISO;
$response_text:="2020-04-01,ARS,AED,.0570575091\n2020-04-01,ARS,AUD,.0252416065"
$response_index:=$match($string($response_text),/$temp1,$temp2,$temp3/).index;
4

1 回答 1

0

您可以使用该$eval函数动态创建正则表达式。例如:

(
    $temp1:=ExecutionDate;
    $temp2:=Currency;
    $temp3:=ConvertToCurrencyISO;
    $regex := $eval('/' & $temp1 & ',' & $temp2 & ',' & $temp3 & '/');
    $response_text:="2020-04-01,ARS,AED,.0570575091\n2020-04-01,ARS,AUD,.0252416065";
    $response_index:=$match($response_text,$regex);
)

https://try.jsonata.org/hrE61rzJt

于 2020-04-20T11:14:49.813 回答