擅长:python、mysql、java
<p>使用<a href="https://docs.python.org/3/howto/regex.html" rel="nofollow noreferrer">regular expressions</a>。在</p>
<pre><code>import re
a_list = {"1 .49", "1 .49", "1 .49"}
for a in a_list:
print re.sub(' +.', '.', a)
</code></pre>
<p>结果将是</p>
^{pr2}$