I need to do a complex if-then-else with five preferential options. Suppose I first want to match abc
but if it's not matched then match a.c
, then if it's not matched def
, then %#@
, then 1z;
.
Can I nest the if-thens or how else would it be accomplished? I've never used if-thens before.
For instance, in the string 1z;%#@defarcabcaqcdef%#@1z;
I would like the output abc
.
In the string 1z;%#@defarcabaqcdef%#@1z;
I would like the output arc
.
In the string 1z;%#@defacabacdef%#@1z;
I would like the output def
.
In the string 1z;#@deacabacdf%#@1z;
I would like the output %#@
.
In the string foo;%@dfaabaef#@1z;barbbbaarr3
I would like the output 1z;
.