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

This is one of those things that people will debate about endlessly and ultimately it feels so silly.

The poster asked how to do it, and this person provided a practical regex to cover most (if not all) cases.

Everything else is just pedantic debate.



The pedantic discussions can be fun and educational, but the regex based hack gets the job done in a few minutes, while the pedants are still wrestling with parsers and libraries.

... and then there's the anticipated joy of seeing the pedants' complicated, theoretically correct solution explode because the input wasn't what they assumed, in the first place.

The pedants that have that experience either become enlightened, or vociferously strident about the importance of proper, theoretically correct solutions in place of quick hacks.

Thus the meme status of the SO answer.


The issue is that sometimes you should use a robust parser and do it properly, and sometimes a hacky regex is fine. But people forget that when arguing about which you should use.




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

Search: