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

Depending on how it’s being counted, I have a regex engine in around 30 lines [1] (the parser is longer). It handles branching, grouping, etc. and it’s run time is proportional to the length of the string being searched (I.e. no infinite loops on certain patterns, etc.).

[1] https://github.com/jason-johnson/frobo/blob/master/src/Text/...

The “match” function. And yes, this is ugly and needs to be cleaned up.




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

Search: