nerdexam
National_Instruments

200-500 · Question #208

How many elements does the $matches array contain after the following function call is performed? preg_match('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=200[0-9])/', '21st March 2006', $matches);

The correct answer is C. 3. See the full explanation below for the reasoning.

Question

How many elements does the $matches array contain after the following function call is performed? preg_match('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=200[0-9])/', '21st March 2006', $matches);

Options

  • A1
  • B2
  • C3
  • D4

How the community answered

(43 responses)
  • A
    14% (6)
  • B
    2% (1)
  • C
    79% (34)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full 200-500 Practice