Linux Essentials (010-160) — Question 76

Which operator in a regular expression matches the preceding character either zero or one time?

Answer options

Correct answer: A

Explanation

The correct answer is A because the '?' operator specifically indicates that the preceding character may occur zero or one time. Option B, '*', allows for zero or more occurrences, while C, '+', requires at least one occurrence, and D and E are not valid quantifiers in this context.