nerdexam
Zend

200-710 · Question #200

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

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

Strings & Patterns

Question

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

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

(48 responses)
  • A
    2% (1)
  • B
    79% (38)
  • C
    10% (5)
  • D
    2% (1)
  • E
    6% (3)

Topics

#complex regex#float matching#non-greedy quantifiers#pattern analysis

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice