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)- A2% (1)
- B79% (38)
- C10% (5)
- D2% (1)
- E6% (3)
Topics
#complex regex#float matching#non-greedy quantifiers#pattern analysis
Community Discussion
No community discussion yet for this question.