Capturing multiple things with single regex isn't that simple in JMP as there isn't global matching possibility (
This fairly simple regex does capture first codes for you
Names Default To Here(1);
dt = Open("$DOWNLOADS/data1.jmp");
failure_pattern = "[A-Z]+\d+[A-Z]?";
Eval(EvalExpr(
dt << New Column("A", Character, Nominal, << Formula(
Regex(:Repair Details, Expr(failure_pattern));
));
));
And then pattern matching mess (can be most likely made much better)
Names Default To Here(1);
dt = Open("$DOWNLOADS/data1.jmp");
str = "failure parts replaced (K3; LG69; AK4T). Proceed to next test";
dt << New Column("A", Character, Nominal, << Formula(
failure_pattern = "([A-Z]+\d+[A-Z]?){1,}";
found_list = {};
Pat Match(:Repair Details,
Pat Any(", (") + Pat Regex(failure_pattern) >> match + Pat Any(" .;,)") + Pat Test(
Insert Into(found_list, match);
0
)
);
Concat Items(found_list, ", ");
));
-Jarmo