English subtitles

← 02x-01 Regular Expressions

Get Embed Code
3 Languages

Showing Revision 2 created 10/24/2012 by Amara Bot.

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