Return to Video

Regular Expressions Review - Quiz 2 - Design of Computer Programs

  • 0:00 - 0:04
    And the answer is if the pattern is the empty string, then that matches anything,
  • 0:04 - 0:10
    because the empty string occurs in every text, even if the text is itself empty.
  • 0:10 - 0:12
    So we just return "true" no matter what.
  • 0:12 - 0:18
    If the pattern is the dollar sign, that means that matches only at the very end of the text.
  • 0:18 - 0:23
    So we want to return "true" only if the text is the empty string.
  • 0:23 - 0:30
    So we say "return does the text equal the empty string?" True if that's true, false if that's false.
  • 0:30 - 0:37
    And I put parentheses around it just as a convention of when you're checking in a return value.
  • 0:37 - 0:41
    It makes it a little bit easier to see that this is a return value.
Tytuł:
Regular Expressions Review - Quiz 2 - Design of Computer Programs
Video Language:
English
Team:
Udacity
Projekt:
CS212 - Design of Computer Programs
Duration:
0:41

English subtitles

Revisions Compare revisions