简体   繁体   中英

Does flowgrounds JSONata expressions support regex?

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"))

RegEx and $contains are working correctly in combination.
The reason for your not working expression is that the second parameter of $contains is a string (something like "/xyz/i"). This string is not being interpreted as a regex.

  • your expression: $contains( "abc", "/" & "X" & "/i")
  • to change in: $contains( "abc", $eval("/" & "B" & "/i") )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM