Multiple choice technology operating systems

Which one of the following is the syntax for a pattern that matches the null string or a filename beginning with a or A

  1. ?([A-a].*)

  2. ?([aA]*)

  3. ?([aA].*)

  4. ?([aA]$)
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The pattern ?([aA]) uses ksh extended pattern matching where '?' matches any single character and [aA] matches zero or more 'a' or 'A' characters. The outer (...) makes the entire pattern optional. Together: ? matches one character (a/A), and ([aA]) can match zero or more additional a/A characters, so it matches null string OR filenames starting with a/A.