Feel 语言内置字符串函数 'replace' 会影响搜索模式的第一个匹配项还是所有匹配项?

Does the Feel language builtin string function 'replace' affect the first match or all occurrances of the search pattern?

决策模型和符号感觉语言有许多内置函数。 对于字符串,一个函数是 replace。它接受搜索字符串、正则表达式模式、替换字符串和可选标志。

replace 是仅作用于第一个正则表达式匹配还是替换所有匹配? DMN 1.3 版规范,第 138 页,似乎没有解决这个问题。

在您的问题中,它替换了所有匹配项。

其他一些有效示例:

replace("banana","a","o") = "bonono"

作为 agreed behaviour test cases 之一,来自 DMN TCK 项目。

我同意 OMG 的 DMN 规范文档,它可以列出一些更实际的例子:)