简体   繁体   English

wso2 CEP内置功能-isMatch

[英]wso2 CEP in-built function - isMatch

I am trying to use CEP 3.1.0 with a built in function for regexp matching 我正在尝试使用带有内置功能的CEP 3.1.0进行正则表达式匹配

 from cseEventStream[isMatch('foo\sbar',symbol)] 

which should match "foo bar" and not "foobar". 应该匹配“ foo bar”而不是“ foobar”。 However, this fails with an error mesage 但是,此操作失败并显示错误消息

mismatched character '\\' expecting ''' 字符“ \\”不匹配,期望为“''

I have tried escaping with multiple '\\'. 我尝试使用多个'\\'转义。 Also, [isMatch('foo bar',symbol)] does not work. 另外,[isMatch('foo bar',symbol)]不起作用。 Although, from cseEventStream[symbol contains 'foo\\sbar'] is a temporary workaround, the inability to use '\\' is a severe limitation in regexp matching. 尽管从cseEventStream [符号包含'foo \\ sbar']开始是暂时的解决方法,但是无法使用'\\'是正则表达式匹配中的严重限制。

Well it's looking for the '\\' character. 好吧,它正在寻找'\\'字符。 What does it say in the isMatch documentation? 在isMatch文档中怎么说? As it says it is expecting a ' then maybe you have to use '\\ ?? 就像它说的那样,期望',那么您可能必须使用'\\ ??

It seems an issue with the siddhi compiler when handling "\\". 处理“ \\”时,siddhi编译器似乎存在问题。 I have raised a jira at [1] and attached the patch which solves the issue as well..We'll fix it in next release.. 我在[1]处提出了一个jira并附加了可解决此问题的补丁。我们将在下一个版本中对其进行修复。

[1] https://wso2.org/jira/browse/CEP-865 [1] https://wso2.org/jira/browse/CEP-865

Thanks.. 谢谢..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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