Regex can't be used to parse HTML in essence because it can't keep track of how far its recursed. Thus you'll always have problems with stuff like nested <div>s. If what you're looking for doesn't have that problem, then you can use regex. In this case, Conor is looking for everything between <div class="content"> and </div>, basically.
You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...
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 grammar). Since a Type 2 grammar is fundamentally more complex than a Type 3 grammar (see the Chomsky hierarchy), you can't possibly make this work. But many will ...
Don't listen to these guys. You actually can parse context-free grammars with regex if you break the task into smaller pieces. You can generate the correct pattern with a script that does each of these in order:
Solve the Halting Problem.
Square a circle (simulate the "ruler and compass" metho...
@Helka Homba, yes, I do not disagree, that can work. I am saying that under most use cases one shoot avoid using regular expressions to parse html. While under sertain circumstances you can get away with it, it should be avoided in favor of a more practical apporach. But in the end a regex can be a vaible solution on some hyml
@ArtOfCode I have a Bootcamp Windows partition but my girlfriend and I used the same copy of Windows for our partitions, so whenever we both boot into Windows, Windows freaks the fuck out.
@JoeZ. Just to let you know, as someone who saw the message out of context without reading through the transcript, I immediately assumed it was a joke. Not to say it's funny, but to let you know I doubt many people took it for a serious statement.
@flawr Not necessarily. Plenty of people play "regular" guitars without a pick. But classical guitars are basically never intended to be used with a pick.
@Dennis Well, it doesn't work for me locally to test but I'll ultimately be running it on an Ubuntu VM, so maybe that's okay. I'll boot up my Ubuntu VM and see what happens.
C (86 bytes):
for(int c=-11,n=-26;++n<1;){while(c++){printf("%c%c",90+n,n?91+n:65);}c=-11;puts("");}
My first attempt on a Code Golf challenge.
Some answers are really impressive!
@IanC One of the original moderators, dmckee, named it. In regular golf, the nineteenth hole refers to the bar at the end of the golf course. And we count things in bytes. Thus The Nineteenth Byte was born.