Multiple choice technology programming languages

The purpose of ?: in this is /(?: [a-z]+/ is?

  1. To enclose a subpattern in parenthesis without storing it in memory.

  2. To define a boundary condition

  3. To enclose a pattern within pattern

  4. None of the above

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

(?: ...) in regex is a non-capturing group. It groups the subpattern (one or more letters) without storing the matched text in memory (unlike ordinary parentheses which create capture groups). This saves memory when you don't need backreferences.