1

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?

Community
  • 1
  • 1
Kacu
  • 438
  • 4
  • 23

2 Answers2

1

Try this regex:

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

Since isMatch is trying to match full input string.

anubhava
  • 761,203
  • 64
  • 569
  • 643
0
(^123|^234|^345)[0-9]*$

Try this.See demo.

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

vks
  • 67,027
  • 10
  • 91
  • 124
  • Thx, for your reply, but in this CEP version is a bug with '\' character and it will be fix in another release => https://wso2.org/jira/browse/CEP-865 – Kacu Jan 26 '15 at 15:18
  • Sorry, it works well. I didn't copy everythig. The only difference between yours trick and @anubhava is that in anubhava '123' input string works. – Kacu Jan 26 '15 at 15:33