re.sarch(pattern, str).span()

返回匹配到的字符的起始索引位置和结束索引位置

    str = '445076.83'
    span = re.search("\.", str).span()
    print(span)
posted @ 2021-04-14 14:12  轩辕吊雷  阅读(113)  评论(0)    收藏  举报