Almo
Masterblazer
So, apparently Regex can't parse HTML. At least, not all of it. But people who keep asking how to do it precipitated this answer on StackOverflow:
http://stackoverflow.com/questions/...ept-xhtml-self-contained-tags/1732454#1732454
For those who are curious about why this is true:
But:
And if you're wondering about this bit:
StackOverflow has a reputation system. Jon Skeet has the highest rep there, which is saying something because they have TONS of users.
And if you want to see something really weird, you can go to this chat room at StackOverflow:
http://chat.stackoverflow.com/rooms/7/c
Open a Javascript console at it, and type:
Eggs.Cthulu("<[^>.*]");
Which will spray pieces of the post I linked to at the top all over the page.
There are some VERY strange things out there on the net...
http://stackoverflow.com/questions/...ept-xhtml-self-contained-tags/1732454#1732454
For those who are curious about why this is true:
Some guy on the internet said:I think the flaw here is that HTML is a Chomsky Type 2 grammar (context free grammar) and RegEx is a Chomsky Type 3 grammar (regular expression). Since a Type 2 grammar is fundamentally more complex than a Type 3 grammar - you can't possibly hope to make this work. But many will try, some will claim success and others will find the fault and totally mess you up.
But:
Some other guy on the internet said:Chuck Norris can parse HTML with regex.
And if you're wondering about this bit:
Jon Skeet cannot parse HTML using regular expressions.
StackOverflow has a reputation system. Jon Skeet has the highest rep there, which is saying something because they have TONS of users.
And if you want to see something really weird, you can go to this chat room at StackOverflow:
http://chat.stackoverflow.com/rooms/7/c
Open a Javascript console at it, and type:
Eggs.Cthulu("<[^>.*]");
Which will spray pieces of the post I linked to at the top all over the page.
There are some VERY strange things out there on the net...