Multiple choice technology programming languages

a\Sz

  1. would match any three-character string starting with "a" and ending with "z" whose second character was not a space, tab or newline.

  2. the second character could be a letter, number or symbol

  3. would match any three-character string starting with "a" and ending with "z" whose second character was a newline

  4. None of the above

Reveal answer Fill a bubble to check yourself
A,B Correct answer
Explanation

In regex, \S (uppercase S) matches any non-whitespace character - that is, any character that is NOT a space, tab, or newline. Therefore the pattern a\Sz matches a 3-character string starting with 'a', ending with 'z', with any non-whitespace character in between. This includes letters, numbers, and symbols. Option C is incorrect because \S explicitly excludes newlines.