RegEx match open tags except XHTML self-contained tags (2009)
stackoverflow.com
RegEx match open tags except XHTML self-contained tags (2009)
1–4 of 4 posts
Re: RegEx match open tags except XHTML self-contained tags (2009)
#2What do you think of http://lambdaway.free.fr/lambdawalks/?view=levithan and http://lambdaway.free.fr/lambdawalks/ ?
Re: RegEx match open tags except XHTML self-contained tags (2009)
#3Somebody 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/ ?
Definitely reminds me a lot of not needing parentheses on an RPN calculator, and the isomorphism between Lisp expressions and Forth expressions.
Re: RegEx match open tags except XHTML self-contained tags (2009)
#4Somebody 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.
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.