Python Regex Easy


  • 0
    A

    """
    import re;
    class Solution(object):
    def detectCapitalUse(self, word):
    patern=r'(^[a-z]+$|^[A-Z]+$|^[A-Z]{1}[a-z]+$)'
    if re.match(patern,word):
    return True
    else:
    return False
    """


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.