Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Disagree here, the problem is their implementation was slightly different to Git's. There is more chance of stuffing up like this with a handrolled parser than with a regex. The only viable alternative i'd accept here to actually reduce risk is to call into libgit itself. Absent that, a regex is appropriate for this problem.

There are many problems where regexes are succinct and appropriate, (of course there are many more where they are neither).



Unless git uses regex, it is almost impossible to verify that the regex is same as their validation. What if git's validation changes. Even looking at the corrected regex I am not sure what would happen for strings like '<[email protected]>>' or '<' or 'x <a>'. Not saying the github's corrected regex is wrong, but it is a mental challenge to verify it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: