1 00:00:00,000 --> 00:00:03,000 Hi, I'm Peter Chapman, and welcome to the first Office Hours 2 00:00:03,000 --> 00:00:06,000 for CS 262 Building a Web Browser. 3 00:00:06,000 --> 00:00:09,000 I'm your assistant instructor, and I'm filling in for Professor Westley Weimer, 4 00:00:09,000 --> 00:00:11,000 who's currently at a conference. 5 00:00:11,000 --> 00:00:13,000 My name's Andy. 6 00:00:13,000 --> 00:00:15,000 I'm the assistant instructor for CS 212, 7 00:00:15,000 --> 00:00:18,000 which is Peter Norvig's class on the design of computer programs. 8 00:00:18,000 --> 00:00:21,000 And I'm going to be filling in the role of the student today 9 00:00:21,000 --> 00:00:23,000 and asking Peter here 10 00:00:23,000 --> 00:00:28,000 all of the questions that you came up with in the forums. 11 00:00:28,000 --> 00:00:30,000 So let's start off. 12 00:00:30,000 --> 00:00:34,000 The first question we had, Peter, was why are we learning regular expressions at all? 13 00:00:34,000 --> 00:00:38,000 Why is this useful for a class on programming languages? 14 00:00:38,000 --> 00:00:41,000 The class is structured around building a web browser, 15 00:00:41,000 --> 00:00:44,000 and our web browser needs to interpret html. 16 00:00:44,000 --> 00:00:47,000 The first step to do that is to identify the parts of html. 17 00:00:47,000 --> 00:00:50,000 We want to identify which part is the beginning of a tag, 18 00:00:50,000 --> 00:00:54,000 the end of a tag, what's a hyperlink, what's just text and words and whatnot. 19 00:00:54,000 --> 00:00:57,000 We want to do that very concisely 20 00:00:57,000 --> 00:01:00,000 with the powerful tool that is regular expressions. 21 00:01:00,000 --> 00:01:02,000 Regular expression just allows you to write some text, 22 00:01:02,000 --> 00:01:05,000 and it very precisely and easily identifies 23 00:01:05,000 --> 00:01:09,000 strings that can match, say, our tags or hyperlinks. 24 00:01:09,000 --> 00:01:12,000 Okay, and I've seen the beginning of Unit 2, 25 00:01:12,000 --> 00:01:14,000 and it seems like that gets reintroduced then. 26 00:01:14,000 --> 99:59:59,999 Yeah, we use it a lot throughout the course.