Hacker News new | past | comments | ask | show | jobs | submit login

Your proposed implementation makes sense for the case of merely taking the complement of a simple regular expression. But the point of having the complement operator available is to be able to take complements of arbitrary sub-expressions within the RE, and even having nested complements in the RE. In that case your proposed implementation would be relatively inefficient.



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

Search: