I'm trying patterns for the first time and think I'm not getting something. My goal is to start with a raw string, and extract from it the first three letters or numbers I find, without regard to them being contiguous. I also want to make the letters uppercase. Here are some inputs and outputs I'd like to get:
input output
A A
a A
AA AA
AA+ AA
A+A AA
A3 A3
ABCD ABC
2ABCD 2AB
The attached VI has 3 versions of this attempt inside it.
The first version uses 3 pattern match VIs that peel characters off one at a time and concatenates them. It seems to do what I want, but I thought I could do something simpler. This looks to me like a kind of dumb brute force method.
The second version is what I thought I could make work. Is there a matching expression that would do it? I tried various combinations of () and + and | and other things but didn't hit it.
Also, I think the third version should work. But I never got anything out of the submatch terminals. Do I misunderstand what they're for or just not know how to use them?