1

I'm trying to build a fairly complex expression with a CBR where I try to identify if a string contains another string. In order to do so I need to manipulate the second string and use a little bit of regex magic but it doesn't seem to work. Could anyone confirm if the JSONata implementation of flowground support regex inside a "contains" operation? The expression I am using right now is the following:

$not($contains(elements[0].attribs.content,"/" & $replace(elasticio."step_1".body.issue.fields."customfield_22519"[0],"-"," ") &"/i"))
4

1 回答 1

2

RegEx 和 $contains 结合使用可以正常工作。
您的表达式不起作用的原因是 $contains 的第二个参数是一个字符串(类似于“/xyz/i”)。此字符串不会被解释为正则表达式。

  • 你的表达: $contains("abc", "/" & "X" & "/i")
  • 更改: $contains("abc", $eval("/" & "B" & "/i") )
于 2019-11-26T15:47:16.890 回答