Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
RegEx match open tags except XHTML self-contained tags (2009) (stackoverflow.com)
2 points by Cieplak on Dec 7, 2022 | hide | past | favorite | 3 comments


Somebody says "You can't parse [X]HTML with regex."

What do you think of http://lambdaway.free.fr/lambdawalks/?view=levithan and http://lambdaway.free.fr/lambdawalks/ ?


Super interesting! My first reaction is, doesn't the while loop, combined with the conditional predicate of the string comparison, essentially promote the regular expression (finite state automaton) into a context-free expression (pushdown automaton)?

Definitely reminds me a lot of not needing parentheses on an RPN calculator, and the isomorphism between Lisp expressions and Forth expressions.


Thank you for your interest. I note that your "about" mentions the Y-combinator λ𝑓.(λ𝑥.𝑓(𝑥𝑥 𝑥))(λ𝑥.𝑓(𝑥 𝑥)) and I would be happy to have your opinion on this page http://lambdaway.free.fr/lambdawalks/?view=lambda_calculus2

And about your question I will say that I didn't know that it was impossible (Chomsky & Co) to parse s-expressions with regular expressions and, thanks to StevenLevithan, I built one. And definitely, at least for me, the standard way using an AST doesn't fit my needs, as you could see here http://lambdaway.free.fr/lambdawalks/?view=lambdacode.




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

Search: