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

No you can't.

HTML is a Context Free Language (Type 2 in the Chomsky hierarchy) that is defined by a Context Free Grammar, and parsed by a stack machine.

Regular expressions can describe regular (Type 3) languages. They do not have a stack.

Note that there is a loop in the code, so it's not just regular expressions.



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

Search: