Y
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
Gibbon1
3741 days ago
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.
link
kpil
3741 days ago
I just realized that our codebase is probably relatively ok...
link
userbinator
3741 days ago
If only they had just looked for the whole key:
ts = parseInt(jsonstr.indexOf("\"ts\":")+5);
link