easyMultiple ChoiceObjective-mapped
200-901 Practice Question: Refer to the exhibit
Exhibit
R1# show ip route
Codes: L - local, C - connected, S - static, R - RIP, O - OSPF, B - BGP
D - EIGRP, EX - EIGRP external, N - NAPT
Gateway of last resort is 10.0.0.1
10.0.0.0/8 is variably subnetted, 2 subnets
C 10.0.0.0/24 is directly connected, GigabitEthernet0/0
S 10.0.1.0/24 [1/0] via 10.0.0.2Refer to the exhibit. A developer is parsing the output of 'show ip route' using Python. Which regular expression would extract the prefix '10.0.1.0/24'?
⚠ Common exam trap
Cisco often tests the distinction between capturing only the IP address versus the full CIDR prefix, leading candidates to pick options that omit the subnet mask (like Option B) or use overly broad patterns (like Option C) that match unintended fields.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
r'^S\s+(\d+\.\d+\.\d+\.\d+/\d+)'
The regex `^S\s+(\d+\.\d+\.\d+\.\d+/\d+)` matches lines starting with 'S' (static route) followed by whitespace, then captures the entire prefix including both the IP address and subnet mask in CIDR notation (e.g., 10.0.1.0/24). This ensures the extracted string is exactly the prefix as it appears in the 'show ip route' output.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
r'^S\s+(\d+\/\d+)'
Why it's wrong here
Only captures network and mask without dots, e.g., '10/24'.
- ✗
r'^S.*(\d+\.\d+\.\d+\.\d+)'
Why it's wrong here
Captures IP without subnet mask, and .* may skip prefix.
- ✗
r'S\s+(\S+)'
Why it's wrong here
Lacks start anchor and may match other lines with 'S'.
- ✓
r'^S\s+(\d+\.\d+\.\d+\.\d+/\d+)'
Why this is correct
Correctly anchors at line start and captures prefix.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every 200-901 question from scratch — 989 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.