Kacu
Kacu

Reputation: 438

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.

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. I have 3 different number to check.

I check this regex in this site -> http://regexr.com/ and it works well. When input stream is like 1234456, on that site regex works well, but the same situation in CEP doesn't work. In CEP works only 123 or 234 or 345, but non of this 123456, 234567, 345677.

Somebody, knows why?

Upvotes: 1

Views: 97

Answers (2)

vks
vks

Reputation: 67988

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

Try this.See demo.

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

Upvotes: 0

anubhava
anubhava

Reputation: 785991

Try this regex:

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

Since isMatch is trying to match full input string.

Upvotes: 1

Related Questions