markers.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Blender-power-sequencer 作者: GDquest 项目源码 文件源码
def string_find_id(string, regex):
    """Find a marker's ID using a regular expression
    returns the ID as int if found, otherwise returns None
    Args:
        -string, any string
        -regex, the regex pattern to match."""

    if not string and regex:
        raise AttributeError("Missing name or regex attribute")

    import re
    index = re.search(regex, string)
    if index:
        found_id = index.group(1)
        return int(found_id) if found_id else None
    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号