简体   繁体   English

WSO2 CEP isMatch内置功能无法正常运行

[英]WSO2 CEP isMatch in-built function doesn't work properly

In Wso2 CEP v 3.1.0 I have to use isMatch function in this situation. 在Wso2 CEP v 3.1.0中,在这种情况下,我必须使用isMatch函数。

from in_put[isMatch('^123|^234|^345', a)]
select b,c
insert into out_put1;

In input stream I have 3 variables (a,b,c), a-variable is 9 digits number where I have to check first 3 digits. 在输入流中,我有3个变量(a,b,c),a变量是9位数字,我必须检查前3位数字。 I have 3 different number to check. 我要检查3个不同的号码。

I check this regex in this site -> http://regexr.com/ and it works well. 我在此站点-> http://regexr.com/上检查了此正则表达式,它运行良好。 When input stream is like 1234456, on that site regex works well, but the same situation in CEP doesn't work. 当输入流类似于1234456时,该站点上的正则表达式工作良好,但CEP中的相同情况不起作用。 In CEP works only 123 or 234 or 345, but non of this 123456, 234567, 345677. 在CEP中只能使用123或234或345,但不能使用此123456、234567、345677。

Somebody, knows why? 有人知道为什么吗?

Try this regex: 试试这个正则表达式:

from in_put[isMatch('^(123|234|345).*', a)]

Since isMatch is trying to match full input string. 由于isMatch试图匹配完整的输入字符串。

(^123|^234|^345)[0-9]*$

Try this.See demo. 试试看。看演示。

https://www.regex101.com/r/rG7gX4/29 https://www.regex101.com/r/rG7gX4/29

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

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