IT 117: Intermediate to Scripting
Answers to Class 11 Ungraded Quiz

  1. What three things are found in a regular expression?
    ordinary characters, meta-characters, character classes
  2. What do ordinary characters in a regular expression match?
    they match themselves
  3. What does the . (dot) in a regular expression match?
    one occurrence of any character, except the newline
  4. What does the * in a regular expression match?
    0 or more occurrences of the character that comes before it
  5. What does the + in a regular expression match?
    1 or more occurrences of the character that comes before it
  6. What does the ? in a regular expression match?
    0 or 1 occurrences of the character that comes before it
  7. What does the \ do in a regular expression?
    turns off the special meaning of the character that comes after it
  8. What does \d in a regular expression match?
    a single digit
  9. What does \w in a regular expression match?
    a single occurrence of a letter, a digit or an underscore
  10. What does \s in a regular expression match?
    a single occurrence of a whitespace character