摘要: 正则校验 判断中文字符 test_str = ' ' pattern = re.findall('[^\x00-\xff]' , test_str) if len(test_str)>len(pattern): print('不符合') 阅读全文
posted @ 2022-01-07 18:11 .Curry 阅读(321) 评论(0) 推荐(0)
摘要: 获取最后一个' . '之前的字符 ceshi_str = '.error.log.2021-12-31_16-39' str_index = ceshi_str.rfind('.') # 获取最后一个点的下标 results = ceshi_str[:str_index] print(results 阅读全文
posted @ 2022-01-07 16:14 .Curry 阅读(1341) 评论(0) 推荐(0)
摘要: phone = '17700000000' phone_after = phone[:3] + '****' + phone[7:] 阅读全文
posted @ 2022-01-07 16:08 .Curry 阅读(791) 评论(0) 推荐(0)