I am a beginner. I am learning Python and trying to do the `Leetcode` problems. I am getting false for the second test case, but for the first case, I am getting false instead of true. Pardon my lack of knowledge. I am willing to learn so please let me know where am I making the mistake.
Ques: Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

```
s= "A man, a plan, a canal: Panama"

```

My Output: false
Expected Output: true

My solution:

```
class Solution:

    def isPalindrome(self, s: str) -> bool:
        for i in range(0,len(s)-1):
            if s==s[::-1]:
                import re
                regex = re.compile('[^a-zA-Z]')
                s=regex.sub('', 'ab3d*E')
                s_lower = s.lower()
                return s_lower
            else:
                break

```