Cisco
210-255 · Question #171
210-255 Question #171: Real Exam Question with Answer & Explanation
The correct answer is C: [a-z]+. The regex [a-z]+ uses a character class to match one or more lowercase ASCII letters exclusively.
Security Monitoring
Question
Which regex matches on all lowercase letters only?
Options
- A[a-z]+
- Ba*z+
- C[a-z]+
- Da-z+
Explanation
The regex [a-z]+ uses a character class to match one or more lowercase ASCII letters exclusively.
Common mistakes.
- A. Although visually similar, this option contains non-standard or improperly encoded bracket characters that would not be interpreted correctly as a regex character class by standard engines.
- B. a*z+ matches zero or more literal 'a' characters followed by one or more literal 'z' characters, not a range of lowercase letters.
- D. a-z+ treats 'a-z' as a literal string sequence outside of brackets and applies '+' only to 'z', so it does not define a character class and does not match all lowercase letters.
Concept tested. Regex character class syntax for lowercase matching
Reference. https://www.regular-expressions.info/charclass.html
Topics
#regex#pattern matching#log analysis#security tooling
Community Discussion
No community discussion yet for this question.