nerdexam
National_Instruments

200-500 · Question #180

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 separators. 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 separators.
  • BIt matches float numbers without thousand separators.
  • CIt matches binary integer numbers.
  • DIt matches any string.
  • EIt does not match anything

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    72% (36)
  • C
    16% (8)
  • D
    2% (1)
  • E
    6% (3)

Community Discussion

No community discussion yet for this question.

Full 200-500 Practice