Regular Expression Matching


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
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
本文标题:LeetCode1.5
本文链接:https://www.haomeiwen.com/subject/hatjrqtx.html
网友评论