300-070 · Question #175
Which pattern does the route pattern \+61278[^3-5]59 match?
The correct answer is D. +61278259001. The route pattern \+61278[^3-5]59 breaks down as follows: '\+' matches a literal plus sign, '61278' matches those exact digits, '[^3-5]' is a negated character class that matches any single digit NOT in the range 3 through 5 (i.e., matches 0,1,2,6,7,8,9), and '59' matches those…
Question
Which pattern does the route pattern +61278[^3-5]59 match?
Options
- A+61278359001
- B+61278459001
- C278259001
- D+61278259001
- E+612783559001
How the community answered
(33 responses)- A3% (1)
- B9% (3)
- C12% (4)
- D73% (24)
- E3% (1)
Explanation
The route pattern +61278[^3-5]59 breaks down as follows: '+' matches a literal plus sign, '61278' matches those exact digits, '[^3-5]' is a negated character class that matches any single digit NOT in the range 3 through 5 (i.e., matches 0,1,2,6,7,8,9), and '59' matches those exact digits. Option D (+61278259001) has a '2' in the wildcard position, and 2 is not in the range 3–5, so [^3-5] matches it. Options A and B fail because they have '3' and '4' respectively in that position, both of which ARE in the excluded range 3–5. Option C fails because it lacks the leading '+'. Option E fails because it inserts extra digits ('35') where only one digit is expected.
Topics
Community Discussion
No community discussion yet for this question.