更新最新代码

This commit is contained in:
2024-03-21 20:32:50 +08:00
parent 1ec018ca90
commit 7d756bcfa4
52 changed files with 38968 additions and 51 deletions
+9
View File
@@ -0,0 +1,9 @@
import re
str = "这是一段测试字符串,@机器人,请回答。"
pattern = r"@机器人"
matches = re.findall(pattern, str)
print(len(matches))
result = re.sub(pattern, "", str)
print(result)