Tip:
Highlight text to annotate it
X
Hi, I'm Peter Chapman, and welcome to the first Office Hours
for CS 262 Building a Web Browser.
I'm your assistant instructor, and I'm filling in for Professor Westley Weimer,
who's currently at a conference.
My name's Andy.
I'm the assistant instructor for CS 212,
which is Peter Norvig's class on the design of computer programs.
And I'm going to be filling in the role of the student today
and asking Peter here
all of the questions that you came up with in the forums.
So let's start off.
The first question we had, Peter, was why are we learning regular expressions at all?
Why is this useful for a class on programming languages?
The class is structured around building a web browser,
and our web browser needs to interpret html.
The first step to do that is to identify the parts of html.
We want to identify which part is the beginning of a tag,
the end of a tag, what's a hyperlink, what's just text and words and whatnot.
We want to do that very concisely
with the powerful tool that is regular expressions.
Regular expression just allows you to write some text,
and it very precisely and easily identifies
strings that can match, say, our tags or hyperlinks.
Okay, and I've seen the beginning of Unit 2,
and it seems like that gets reintroduced then.
Yeah, we use it a lot throughout the course.