[英]case insensitive replacement in python using re
with this code使用此代码
import re
str = 'hi my name is Alice'
print(re.sub(str, 'hi', 'hello', re.IGNORECASE))
I got hello
我
hello
I expect it would be hello my name is Alice
我希望它会是
hello my name is Alice
What's wrong here?这里有什么问题?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.