Question 1
Back to Exercise
What is the difference between re.match() and re.search()?
- A match looks only at the start of the string; search scans the whole string Correct
- B match returns a list; search returns a string
- C They are identical
- D search looks only at the end of the string
Correct Answer: Option A
re.match(r"\d", "a1") is None, while re.search finds the 1.
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!