【发布时间】:2019-11-13 13:26:00
【问题描述】:
我在流中获取字符串数据,我想只保留字母数字字符。我注意到 Siddhi 提供了一个正则表达式函数,如 here 所述。但问题是它返回一个布尔值而不是修改后的字符串。反正有没有直接得到修改后的字符串?这是我的代码。
@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;
有没有返回修改后的正则表达式字符串的函数?
【问题讨论】:
标签: siddhi stream-processing wso2sp event-stream-processing