1. Home
  2. Data Science
  3. Python
  4. In regular expressions, what does the dot . match by…

Added 25 Nov 2026

In regular expressions, what does the dot . match by default in Python?

  1. Only a period
  2. Any character except a newline Correct answer
  3. Any digit
  4. Only letters

Correct answer

B. Any character except a newline

13 views

MCQSEXAM

Explanation

The dot matches any single character apart from newline unless DOTALL is set.

Reference

Asked in: Python Interview Standard Library

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs