nerdexam
Zend

200-550 · Question #179

Which sentence describes the following regular expression match? preg_match('/^\d+(?:\.[0-9]+)?$/', $test);

The correct answer is B. It matches float numbers without thousand seperators. See the full explanation below for the reasoning.

Question

Which sentence describes the following regular expression match? preg_match('/^\d+(?:.[0-9]+)?$/', $test);

Options

  • AIt matches float numbers with thousand seperators.
  • BIt matches float numbers without thousand seperators.
  • CIt matches binary integer numbers.
  • DIt matches any string.
  • EIt does not match anything

How the community answered

(35 responses)
  • A
    17% (6)
  • B
    71% (25)
  • C
    6% (2)
  • D
    3% (1)
  • E
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 200-550 Practice