10,正则表达式匹配

class Solution:
    def isMatch(self, s: str, p: str) -> bool:
        import re
        rlt = re.match(p, s)
        try:
            if s == rlt.group():
                return True
            else:
                return False
        except Exception:
            return False

猜你喜欢

转载自blog.csdn.net/weixin_42758299/article/details/88533357