41. In the functions re.search.start(group) and re.search.end(group), if the argument groups not specified, it defaults to . . . . . . . .
42. What is a character class in regular expressions?
43. What will be the output of the following Python code?
re.split(r'(a)(t)', 'Maths is a difficult subject')
re.split(r'(a)(t)', 'Maths is a difficult subject')
44. What will be the output of the following code:
import re
pattern = re.compile(r'b[A-Z]+b')
result = pattern.findall('Hello, WORLD!')
print(result)
import re
pattern = re.compile(r'b[A-Z]+b')
result = pattern.findall('Hello, WORLD!')
print(result)
45. What will be the output of the following Python code?
n = re.sub(r'\w+', 'Hello', 'Cats and dogs')
n = re.sub(r'\w+', 'Hello', 'Cats and dogs')
46. What is the purpose of the re.sub() function in Python?
47. What is the purpose of the re.MULTILINE flag in Python?
48. The difference between the functions re.sub and re.subn is that re.sub returns a . . . . . . . . whereas re.subn returns a . . . . . . . .
49. What will be the output of the following Python code?
re.split('mum', 'mumbai*', 1)
re.split('mum', 'mumbai*', 1)