python类endbracket()的实例源码

feedparser.py 文件源码 项目:StuffShare 作者: StuffShare 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self):
            # Overriding the built-in sgmllib.endbracket regex allows the
            # parser to find angle brackets embedded in element attributes.
            self.endbracket = re.compile('''([^'"<>]|"[^"]*"(?=>|/|\s|\w+=)|'[^']*'(?=>|/|\s|\w+=))*(?=[<>])|.*?(?=[<>])''')
feedparser.py 文件源码 项目:StuffShare 作者: StuffShare 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def search(self, target, index=0):
            match = self.endbracket.match(target, index)
            if match is not None:
                # Returning a new object in the calling thread's context
                # resolves a thread-safety.
                return EndBracketMatch(match)
            return None


问题


面经


文章

微信
公众号

扫码关注公众号