51. Which of the following functions returns a dictionary mapping group names to group numbers?
52. What will be the output of the following Python code?
re.split('[a-c]', '0a3B6', re.I)
re.split('[a-c]', '0a3B6', re.I)
53. What will be the output of the following Python code?
import re
s = 'abc123 xyz666 lmn-11 def77'
re.sub(r'\b([a-z]+)(\d+)', r'\2\1:', s)
import re
s = 'abc123 xyz666 lmn-11 def77'
re.sub(r'\b([a-z]+)(\d+)', r'\2\1:', s)
54. Which of the following statements regarding the output of the function re.match is incorrect?
55. How can you replace a matched pattern with a new string using regular expressions in Python?
56. Which of the following pattern matching modifiers permits whitespace and comments inside the regular expression?
57. How can you match zero or more occurrences of a pattern in regular expressions?
58. What will be the output of the following Python code?
re.split(r'(n\d)=', 'n1=3.1, n2=5, n3=4.565')
re.split(r'(n\d)=', 'n1=3.1, n2=5, n3=4.565')
59. Choose the option wherein the two choices do not refer to the same option.
60. What will be the output of the following code:
import re
result = re.findall(r'd{1,3}', 'There are 25 apples and 300 oranges.')
print(result)
import re
result = re.findall(r'd{1,3}', 'There are 25 apples and 300 oranges.')
print(result)