Python 正则表达式 : get everything except for string

标签 python regex

<分区>

我有以下句子:

Graft Concepts has partnered with\u00a0several sites\u00a0to offer customization options for backplates, so customers will be able to design their own with\u00a0 

我想去掉“\u00a0”的所有实例,无论它们是否连接到其他词,例如“与\u00a0几个”

我如何使用正则表达式和 python 来做到这一点?我已尝试使用 re.compile() 和 re.findall() 进行试验,但无法正常工作?

谢谢。

最佳答案

你可以只使用.replace:

s = s.replace('\\u00a0', ' ')

关于Python 正则表达式 : get everything except for string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18326762/

相关文章:

python - 日期时间转换 - 如何提取推断的格式?

python - 为什么我在 python 3.6 的 jupyter Notebook 中收到警告以及如何修复它们?

java - 如何从基于斜杠的分区中排除单字符表达式?

python - 如何在 Python 中导入外部类并从中创建对象?

python - 将滚动条放在 Canvas 上的框架上

python - Pandas 堆栈/取消堆栈结果错误

javascript - javascript正则表达式中的后视断言语法错误

regex - 如何简化此正则表达式以在 Google Analytics 中使用

Javascript unicode字符串,中文字符但没有标点符号

regex - 使用 REGEX 进行大小写转换