Hacker News new | ask | show | jobs
by nothrabannosir 3742 days ago
Guessing they're scanning for parameters in a JSON object by doing something like

    ts = parseInt(jsonstr.indexOf("ts")+2);
I wish I didn't come to this guess by seeing it in real code so many times…

T_T

3 comments

One of the reasons I've always been leery of regex. Especially since everyone I've seen using them tends to blindly copy an example from elsewhere and then bats at it until the test case passes.
I just realized that our codebase is probably relatively ok...
If only they had just looked for the whole key:

    ts = parseInt(jsonstr.indexOf("\"ts\":")+5);