Direction: Choose the correct option
Q1.
Which module provides regular expression support in Python?
Direction: Choose the correct option
Q2.
What does `re.search(pattern, string)` do?
Direction: Choose the correct option
Q3.
How do you find all occurrences of a pattern?
Direction: Choose the correct option
Q4.
What is the output of `re.findall(r'd+', 'a1b22c333')`?
Direction: Choose the correct option
Q5.
What does `re.sub(r's+', '-', 'hello world')` return?
Direction: Choose the correct option
Q6.
How do you compile a regex pattern for reuse?
Direction: Choose the correct option
Q7.
What does `re.match()` do?
Direction: Choose the correct option
Q8.
What is the purpose of groups in regex?
Direction: Choose the correct option
Q9.
How do you access captured groups in a match object?
Direction: Choose the correct option
Q10.
What does the flag `re.IGNORECASE` do?
