Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Zend 200-710 Exam - Topic 8 Question 9 Discussion

Actual exam question for Zend's 200-710 exam
Question #: 9
Topic #: 8
[All 200-710 Questions]

How many elements does the $matches array contain after the following function call is performed?

preg_match('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=201[0-9])/', '21st March 2014', $matches);

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

0/2000 characters
Leanora
5 months ago
Definitely 2, the regex captures two groups!
upvoted 0 times
...
Alesia
5 months ago
I’m not so sure about that, could be 1 too.
upvoted 0 times
...
Timmy
5 months ago
Wait, really? I thought it might be 3.
upvoted 0 times
...
Ryan
5 months ago
Totally agree, it's 2!
upvoted 0 times
...
Lizbeth
5 months ago
The $matches array will have 2 elements.
upvoted 0 times
...
Shenika
6 months ago
I recall that the first capturing group counts as one, and if there's a second one, that might make it 2. But what about the full match?
upvoted 0 times
...
Francine
6 months ago
I feel like it could be 3 because of the way the regex is structured, but I could be mixing it up with another example.
upvoted 0 times
...
Hillary
6 months ago
I'm not entirely sure, but I remember a similar question where the number of matches was based on the capturing groups.
upvoted 0 times
...
Tomoko
6 months ago
I think the regex captures two groups, so maybe the $matches array has 2 elements?
upvoted 0 times
...
Selma
6 months ago
I'm a bit confused by this question. I'm not sure which method would be the best approach.
upvoted 0 times
...
Yasuko
6 months ago
I'm pretty confident the JeOS toolkit has a command line utility, but I'm not sure about the other two. I'll have to guess on those and hope I get at least one right.
upvoted 0 times
...

Save Cancel