1.

Which of the following functions results in case insensitive matching?(a) re.A(b) re.U(c) re.I(d) re.XI had been asked this question in exam.This interesting question is from Regular Expressions topic in chapter Regular Expressions and Files of Python

Answer»

The correct ANSWER is (c) re.I

Explanation: The function re.I (that is, re.IGNORECASE) RESULTS in case-insensitive matching. That is, EXPRESSIONS such as [A-Z] will match LOWERCASE characters too.



Discussion

No Comment Found

Related InterviewSolutions