Regular Expressions   «Prev  Next»

Unix Regular Expression - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Which of the following two commands are using a regular expression?
Please select all the correct answers.
  A. ls *.jpg
  B. ls –l chap1 chap2 chap3
  C. grep hello letter
  D. grep "[Cc]hap*" myfile
  E. mv [Cc]hap* old_dir

2. Which two patterns will the regular expression [A-Z][a-z].* match?
Please select all the correct answers.
  A. 123Stop
  B. 123stop
  C. Stop123
  D. STOP123

<
3. Which of the following regular expressions must be quoted?
Please select all the correct answers.
  A. what
  B. what?
  C. what I want
  D. [Ww]hat