擅长:python、mysql、java
<p>您可以通过使用<a href="https://docs.python.org/3/library/stdtypes.html#str.replace" rel="nofollow noreferrer">^{<cd1>}</a>在不使用正则表达式的情况下解决此问题:</p>
<pre><code>symbols = {"`", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "-", "+", "=", "{", "[", "]", "}", "|", "\\", ":", ";", "\"", "<", ",", ">", ".", "?", "/"}
for c in symbols:
document = document.replace(c, "")
</code></pre>