Multiple choice technology programming languages

The regex /g.d?c*/ doesn't match

  1. godccc

  2. gddd

  3. goc

  4. gc

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

The regex /g.d?c*/ means: g, then any character (.), then optional d (d?), then zero or more c (c*). For 'gddd': after g and d matching . and d?, the remaining 'dd' cannot be matched because d? can only take one d and c* takes zero c's - leaving unmatched characters.