Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Signature parsing with regular expression failure #69

Open
poojagurubasappa opened this issue Mar 18, 2019 · 2 comments
Open

Signature parsing with regular expression failure #69

poojagurubasappa opened this issue Mar 18, 2019 · 2 comments

Comments

@poojagurubasappa
Copy link

The regular expression used for splitting the signature accesses index 3.
stdout.split(/(\r\n|\n\n)/)[3];

This is breaking since the regular expression doesnt work as expected. The signature is actually present at index 6.

@daniepaul
Copy link

The issue is not with the index. The issue is with the regular expression itself.
it should have been var signature = stdout.split(/(\r\n\r\n|\n\n)/)[3];

#64 broke this in 2.2.0 release.

@vodaben
Copy link
Contributor

vodaben commented May 28, 2019

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];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants