Wouldn't '0Xf' also be matched?So instead of 0x12, only 0x1 will be matched. 0x will be captured as well because of the same reason.
About Question enthuware.ocpjp.v7.2.1424 :
Moderator: admin
-
- Posts: 30
- Joined: Sat May 02, 2015 4:48 pm
- Contact:
About Question enthuware.ocpjp.v7.2.1424 :
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1424 :
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.
The explanation is only talking about the 0x12 part. i.e. instead of the whole 0x12, only 0x1 will be matched.
-
- Posts: 19
- Joined: Wed May 25, 2016 4:33 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1424 :
Hmm, it clearly asks "identify the tokens that will be captured...". Note it's plural "tokens", eg more than 1.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.
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
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1424 :
I am not sure I follow your logic. The question says, "A programmer has written....". And it shows what he/she has written. Now, whether that truly does what is intended is something you can decide if you want but that is not what the question asks.
The question presents a few options and asks you to identify which are the ones that will be captured with the given pattern for the given input.
Will 0x12 be captured? No.
Will 0x be captured? Yes.
Will 0xfm be captured? No
Will 0x3 be captured? No.
Will none of these be captured? No because option2 will be captured.
So I really don't see any ambiguity here.
Paul.
The question presents a few options and asks you to identify which are the ones that will be captured with the given pattern for the given input.
Will 0x12 be captured? No.
Will 0x be captured? Yes.
Will 0xfm be captured? No
Will 0x3 be captured? No.
Will none of these be captured? No because option2 will be captured.
So I really don't see any ambiguity here.
Paul.
-
- Posts: 19
- Joined: Wed May 25, 2016 4:33 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1424 :
Hi Paul,
the ambiguity is as follows:
Please identify the tokens that will be captured with the given input (select 1 answer)
1) 0x
2) 0x 0x1
3) 0x 0xf
4) 0x 0x1 0xf
5) 0x 0x1 0xf x3
6) 0x 0x1 0xf x3 0xfm
Correct answer: #4
I can see how the exam question might work in its current state as well, if you interpret it as "identify which of the below are part of the match".
So it comes down to how do you want to interpret "identify the tokens". It's the "the tokens" that is the ambiguity.
Does it mean all of them (the tokens aka my example above aka the full match) vs "1 or more of the matched tokens aka the mock exam question)".
Cheers,
Dieter
the ambiguity is as follows:
Please identify the tokens that will be captured with the given input (select 1 answer)
1) 0x
2) 0x 0x1
3) 0x 0xf
4) 0x 0x1 0xf
5) 0x 0x1 0xf x3
6) 0x 0x1 0xf x3 0xfm
Correct answer: #4
I can see how the exam question might work in its current state as well, if you interpret it as "identify which of the below are part of the match".
So it comes down to how do you want to interpret "identify the tokens". It's the "the tokens" that is the ambiguity.
Does it mean all of them (the tokens aka my example above aka the full match) vs "1 or more of the matched tokens aka the mock exam question)".
Cheers,
Dieter
Who is online
Users browsing this forum: No registered users and 7 guests