更新最新代码
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import re
|
||||
|
||||
str = "这是一段测试字符串,@机器人,请回答。"
|
||||
|
||||
pattern = r"@机器人"
|
||||
matches = re.findall(pattern, str)
|
||||
print(len(matches))
|
||||
result = re.sub(pattern, "", str)
|
||||
print(result)
|
||||
Reference in New Issue
Block a user