Multiple choice technology programming languages

/de{0,3}/ matches

  1. df

  2. def

  3. deef

  4. deeef

  5. all the above

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

The regex /de{0,3}/ matches 'd' followed by 0 to 3 'e' characters. 'df' matches because {0} allows zero e's. 'def' matches (one e). 'deef' matches (two e's). 'deeef' matches (three e's). All options are valid matches for this pattern.

AI explanation

The quantifier {0,3} means "the preceding token (e) may occur anywhere from 0 to 3 times," and since the regex isn't anchored, it just needs to find d followed by 0–3 es somewhere in the string. df matches with zero es, def matches with one e, deef matches with two, and deeef matches with three — so the pattern successfully matches within all of the given strings.