I'm getting string data in a stream and I would like to keep only the alphanumeric characters. I noticed that Siddhi offers a regexp function, as mentioned here. But the thing is it returns a Boolean instead of the modified string. Is there anyway to get the modified string directly? This is my code.
@App:name("strtest")
@App:description("Description of the plan")
-- Please refer to https://docs.wso2.com/display/SP400/Quick+Start+Guide on getting started with SP editor.
define stream InboundStream(ipstring string);
@sink(type='log', prefix='Modified string')
define stream Opstream(ropstring bool);
from InboundStream
select str:regexp(ipstring, "^A-Za-z0-9") as ropstring insert into Opstream;
Is there a function that returns the modified regex string?