In the functions re.search.start(group) and re.search.end(group), if the argument groups not specified, it defaults to . . . . . . . .
Select an option to see the answer and solution.
What is a character class in regular expressions?
Select an option to see the answer and solution.
What will be the output of the following Python code?
re.split(r'(a)(t)', 'Maths is a difficult subject')
Select an option to see the answer and solution.
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)
Select an option to see the answer and solution.
What will be the output of the following Python code?
n = re.sub(r'\w+', 'Hello', 'Cats and dogs')
Select an option to see the answer and solution.
What is the purpose of the re.sub() function in Python?
Select an option to see the answer and solution.
What is the purpose of the re.MULTILINE flag in Python?
Select an option to see the answer and solution.
The difference between the functions re.sub and re.subn is that re.sub returns a . . . . . . . . whereas re.subn returns a . . . . . . . .
Select an option to see the answer and solution.
What will be the output of the following Python code?
re.split('mum', 'mumbai*', 1)
Select an option to see the answer and solution.
The special character B matches the empty string, but only when it is . . . . . . . .
Select an option to see the answer and solution.
Which of the following functions returns a dictionary mapping group names to group numbers?
Select an option to see the answer and solution.
What will be the output of the following Python code?
re.split('[a-c]', '0a3B6', re.I)
Select an option to see the answer and solution.
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)
Select an option to see the answer and solution.
Which of the following statements regarding the output of the function re.match is incorrect?
Select an option to see the answer and solution.
How can you replace a matched pattern with a new string using regular expressions in Python?
Select an option to see the answer and solution.
Which of the following pattern matching modifiers permits whitespace and comments inside the regular expression?
Select an option to see the answer and solution.
How can you match zero or more occurrences of a pattern in regular expressions?
Select an option to see the answer and solution.
What will be the output of the following Python code?
re.split(r'(n\d)=', 'n1=3.1, n2=5, n3=4.565')
Select an option to see the answer and solution.
Choose the option wherein the two choices do not refer to the same option.
Select an option to see the answer and solution.
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)
Select an option to see the answer and solution.