At a bank, an analyst tests patterns against the address string 10.8.0.15 and must reject any pattern that also matches 192.168.0.15. Which pattern matches 10.8.0.15 and does not match 192.168.0.15?
Select an answer to reveal the explanation.
Short Explanation
A gate that only opens for houses on your own block will ignore the next block over. You want an anchor on 10 followed by a dot, so 10.8.0.15 matches and 192.168.0.15 does not. The trap is an anchor on 192, the letters exec, or a trailing exe.
Full Explanation
The address 10.8.0.15 starts with the characters 1, 0, and a dot. A caret anchors the match at the start, and a backslash makes the dot literal, so that pattern matches the tested string. The address 192.168.0.15 starts with 192, so the same pattern misses it. "The pattern ^10\. anchored so the tested string must begin with 10 and a literal dot" is the pattern that satisfies both conditions. "The pattern ^192, anchored so the string must begin with the digits 192" matches 192.168.0.15 and misses 10.8.0.15. "The pattern exec, requiring those four letters somewhere in the address" does not occur in 10.8.0.15. "The pattern exe$, matching only when the string ends in the letters exe" fails because the address ends in the digits 15. Exam caveat: an unescaped dot matches any one character, so the backslash is what forces a literal dot. Operational check: apply each pattern to both address strings and keep only the one that hits 10.8.0.15 and misses 192.168.0.15. Neither tested address contains the letters exec or ends in exe, so those two patterns cannot satisfy the test.