← Back to questions
Question #73multi-choiceverified

The shown finite state machine is used to check if an input data stream matches with some regular expression. The data matches the regular expression if the final state qd is reached at the end of the input stream. What regualar expression(s) will be checked by the state machine? You may select one or more answers.

Question illustration 1
  1. ^([f|s|g]+(fs|gss|fs))*(fgg|s|gs[gg|s]*)$
  2. ^((g(ss|ff|g))|fs)*(s|((f|gs)?gg))$Correct
  3. ^((g?(ss|g))|fs)+(s|gsgg|gg)$
  4. ^(gff|gss|ff|sf)*(fgg|gsgg|s|gg)$

Official answer

^((g(ss|ff|g))|fs)*(s|((f|gs)?gg))$

Departments

Not tagged yet.

Occurrences

  • FSG 2021 · ev · quiz 8