admin wrote:Yes, it will match 0Xf also.
The explanation is only talking about the 0x12 part. i.e. instead of the whole 0x12, only 0x1 will be matched.
Hmm, it clearly asks "identify the tokens that will be captured...". Note it's plural "tokens", eg more than 1.
Note also how the first part of the question says "to capture all the numbers". Note the "all". So we know the intended regex code (not shown, will not stop at the first match but will capture them all until the end).
I knew it would capture all of these:
0x1
0x
0xf
You are asking me to identify the tokens that will match from this regex, but I cannot identify them as 2 out of 3 is missing.
So in the absence of an answer that covers all 3 tokens, there was no other option than to select "none of the above".
To make this question less ambiguous, I would have either:
1) Enabled selection of 3 answers instead of 1 and included all the 3 tokens as different answers
2) Or include one answer where all tokens are included e.g.: 0x1, 0x, 0xf.
3) Or restate the question to something like "identify which tokens will be part of the output"...
Note that alternative #3 exactly highlights the issue with the current question, it's the whole notion about "part of the output". This is missing, so for me the only possible answer is: 0x1
and 0x
and 0xf.
For me, the intention of the question in the first place should be to test the knowledge and understanding of the concepts, which here is to demonstrate knowledge about regex.
It's no blame to anyone, because if the Oracle test is truly ambiguous like that, then so be it. But it's still pretty damn frustrating when you know regex (very well), but still fail the question!
Cheers,
Dieter