LeetCode交流

LeetCode1.5

2019-01-05  本文已影响0人  supermanwasd

Regular Expression Matching

Screen Shot 2019-01-05 at 10.22.23 PM.png Screen Shot 2019-01-05 at 10.22.29 PM.png

class Solution:
    def isMatch(self, s, p):
        """
        :type s: str
        :type p: str
        :rtype: bool
        """
        if re.compile('^'+p+'$').match(s):
            return True
        return False
上一篇下一篇

猜你喜欢

热点阅读