nerdexam
National_Instruments

200-500 · Question #214

Which parts of the text are matched in the following regular expression? 1 <?php 2 $text = <<<EOT 3 The big bang bonged under the bung. 4 EOT; 6 preg_match_all('@b.n?g@', $text, $matches); 7 ?>

The correct answer is C. big bang bong bung. See the full explanation below for the reasoning.

Question

Which parts of the text are matched in the following regular expression? 1 <?php 2 $text = <<<EOT 3 The big bang bonged under the bung. 4 EOT; 6 preg_match_all('@b.n?g@', $text, $matches); 7 ?>

Options

  • Abang bong bung
  • Bbang bonged bung
  • Cbig bang bong bung
  • Dbig bang bung

How the community answered

(42 responses)
  • A
    2% (1)
  • B
    14% (6)
  • C
    79% (33)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full 200-500 Practice