Which of the codes shown below results in a match?

Which of the codes shown below results in a match? Correct Answer re.match(‘George(?=Washington)’, ‘GeorgeWashington’)

The code shown above demonstrates the use of the function re.match, along with the special character ?=. This results in a match only when ‘George’ is immediately followed by ‘Washington’. Also, we have not used the module to ignore case. Hence the match is case-sensitive. Therefore the only option which results in a match is: re.match(‘George(?=Washington)’, ‘GeorgeWashington’)

Related Questions