Q: The function re.error raises an exception if a particular string contains no match for the given pattern.
Solution: The function re.error raises an exception when a string passed to one of its functions here is not a valid regular expression. It does not raise an exception if a particular string does not contain a match for the given pattern.
Q: Choose the option wherein the two choices do not refer to the same option.
Solution: The function re.L is also written as re.LOCALE. There is no function such as re.LOWERCASE in the re module of Python.
Q: The difference between the functions re.sub and re.subn is that re.sub returns a _______________ whereas re.subn returns a __________________
Solution: The difference the functions re.sub and re.subn is that re.sub returns a string whereas re.subn returns a tuple.
You Have Score    | /3 |