Question 12
Back to Exercise
Which pattern matches "3.14" but not "3x14"?
- A r"\d.\d+"
- B r"\d\.\d+" Correct
- C r"\d*\d+"
- D r"\d+"
Correct Answer: Option B
An unescaped dot matches any character; \. matches only a dot.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!