LPIC-1 Exam 101 (Linux Administrator) — Question 12
What does the ? symbol within regular expressions represent?
Answer options
- A. Match the preceding qualifier one or more times.
- B. Match the preceding qualifier zero or more times.
- C. Match the preceding qualifier zero or one times.
- D. Match a literal ? character.
Correct answer: C
Explanation
The correct answer is C, as the ? symbol indicates that the preceding element may occur either zero or one time. Option A is incorrect because it refers to one or more occurrences, which is represented by the + symbol. Option B also does not apply, as it describes the * symbol, which allows for zero or more occurrences. Option D is not relevant because it describes matching a literal character rather than a quantifier.