ITPEC IP October 2023 Question 2
ITPEC IP October 2023 — Question 2 of 100
The string in option (c) matches the given wildcard pattern. XYX.YXY matches X*.Y??: before the period, the string begins with literal X, and * matches YX. After the period, the string contains literal Y followed by exactly two arbitrary characters, so YXY satisfies that condition.
Answer (c)
Why not others:
- (a) has XYY after the period, which does not begin with the required literal Y
- (b) has only YY after the period, one character too short for Y??
- (d) begins with Y before the period, so it cannot match the required initial literal X
Key rule: * matches any number of characters, including zero; each ? matches exactly one character; ordinary letters and the period must match literally.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.