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

Rhetorical question: Can you ever fully be sure you have the regex you wanted?



Writing regexes by hand is hard so there will always be some level of testing involved. But reading a regex and verifying it works is easier than writing one from scratch.


My overly snide point about regexes was that most of the time "verifying it works" is more like finding and fixing a few more edge cases on the asymptotic journey towards no more brokenness.


Yeah I agree with that! 100% test coverage seems impossible when every part of the regex is basically an if condition.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: