You can use string.match with multiple captures, like in this example, where the parts of the string of the first (.-_.-_) and the second (.*) are stored in B and C respectively:
Code:
A="Inst_1A_8ch_Sus_Leg_idx001_sn_056_en_055"
B,C=A:match("(.-_.-_).*_(.*)")
D=B..C
The first capture (.-_.-_) says:
Take everything from beginning to the first _ and then between the first _ to the second _
inbetween the captures, it shall ignore everthing until the last _
the last capture (.*) says
take everything fom after the last _ til the end.