The regular expression is capturing '\r\n' and '\n\n'. Therefore 3 more captured line breaks are in the result array of stdout.split(/(\r\n\r\n|\n\n)/) and the signature appears in position 6 instead of 3.
I am having success by removing the bracket in the regular expression.
var signature = stdout.split(/\r\n|\n\n/)[3];
The regular expression is capturing '\r\n' and '\n\n'. Therefore 3 more captured line breaks are in the result array of
stdout.split(/(\r\n\r\n|\n\n)/)
and the signature appears in position 6 instead of 3.I am having success by removing the bracket in the regular expression.
var signature = stdout.split(/\r\n|\n\n/)[3];