ekuiper icon indicating copy to clipboard operation
ekuiper copied to clipboard

Regex In SQL

Open sujith1994 opened this issue 3 years ago • 3 comments

Is it possible to use regex in SQL statements? if yes... please give an example of it

sujith1994 avatar May 05 '22 05:05 sujith1994

There are functions like regexp_matches, check https://ekuiper.org/docs/en/latest/sqls/built-in_functions.html#string-functions

ngjaying avatar May 05 '22 06:05 ngjaying

@ngjaying . Can you please confirm the syntax is correct here ? does the case insensitive syntax is correct? { "id": "RegexCheck", "sql": "SELECT CASE WHEN json_path_exists(pipelineList,"$..[? (@.pipelineId =~ \"/abc/i\")]") AND correlationId ="abccorr123rrt" THEN "Success" ELSE "failure#rule conditions not met" END as status_msg,correlationId FROM controlroom", "actions": [ { "log": {} }, { "mqtt": { "server": "tcp://localhost:60020", "topic": "resulttest" } } ] }

sujith1994 avatar May 12 '22 05:05 sujith1994

Is it working for you?

ngjaying avatar Aug 01 '22 01:08 ngjaying

Close for inactive.

ngjaying avatar Sep 01 '22 07:09 ngjaying