Multiple choice technology

Which one of the below checks for the pattern match as x, xx, xxx, ...

  1. *(X)

  2. ?(X)

  3. +(X)

  4. !(X)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

+(pattern) in extglob matches one or more occurrences of the pattern. So +(X) matches X, XX, XXX, etc. *(X) matches zero or more, ?(X) matches zero or one, !(X) matches anything except the pattern.