python正则获取字符串的前七个字符_在字符串的前两个字符后插入“.”的Python正则表达式...
使用以下测试脚本:import redef string(s):return '{}.{}'.format(s[:2], s[2:])def regex(s):return re.sub(r'^(\d{2})', r'\1.', s)def numerical(s):return str(int(s) / (10 ** (len(s) - 2)))if __name__ == '__main__'...