Switch-Case Statements in CloverETL using Regular Expression

Hi,

I would like to ask if it’s possible to use regular expressions as cases in a switch-case statements.

I wanna know how to create cases of regular expressions that will match my data:

My data look like this:

(1) 3 EA OF SKU - 001
(2) 1 EA OF SKU - JKO1
(3) 2 EA OF SKU - PP01
.
.
.
etc

I want that my cases will check if it matches this format: “([0-9]).*”
So, I want to check if it matches an open parenthesis symbol, followed by any number, then closing parenthesis, followed by any character or none.

I would really appreciate any help.

Thanks much,

Hi jed_urETLguy,

I would cut out the number in parenthesis by CTL2 code:


string input = "(3) 2 EA OF SKU - PP01";
string nr = input.find("(?:([0-9]+))")[0];
//nr == "3"

Then convert it into integer and use in case statement.