Zend
200-710 · Question #193
Which parts of the text are matched in the following regular expression? $text = <<<EOT The big bang bonged under the bung. EOT; preg_match_all('/(@b.n?g@', $text, $matches);
The correct answer is C. big bang bong bung. See the full explanation below for the reasoning.
Strings & Patterns
Question
Which parts of the text are matched in the following regular expression?
$text = <<<EOT
The big bang bonged under the bung.
EOT;
preg_match_all('/(@b.n?g@', $text, $matches);
Options
- Abang bong bung
- Bbang bonged bung
- Cbig bang bong bung
- Dbig bang bung
How the community answered
(32 responses)- A9% (3)
- B3% (1)
- C84% (27)
- D3% (1)
Topics
#preg_match_all#regex quantifiers#character patterns#word boundary
Community Discussion
No community discussion yet for this question.