LearnFrenzy
Sign in Take a free test

Regular Expressions · Regular Expressions MCQ · Question 12

Matching a literal dot Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links