I am looking for some help to put a REGEX expression together that will return the contents between ROUTINE and END_ROUTINE
I have tried
ROUTINE S[0-9]{1,5}_[A-Z0-9_]* ([\s\S]*)?(?=END_ROUTINE
)
But it doesnt seem to provide the correct output
ROUTINE S7026_HMI_LB0_SP_MAX
RC: "===================================================================================================$N"
"$N"
"Local HMI Station B Setpoint Commands Max Clamp$N"
"$N"
"===================================================================================================";
N: NOP();
END_ROUTINE
ROUTINE S0100_DIAGNOSTICS
N: JSR(S0101_PLC_Diagnostics,0);
N: JSR(S0102_IO_Diagnostics,0);
END_ROUTINE