擅长:python、mysql、java
<p>你不会用正则表达式来表达这个。如果你的电话号码长度相同</p>
<pre><code>def is_match(phone_nr_1, phone_nr_2):
diff = filter(lambda x: x[0] != x[1],
zip(phone_nr_1, phone_nr_2))
return len(diff) <= 1
print is_match("+31612345678", "+31612245678")
#=> True
print is_match("+31612345678", "+31611145678")
#=> False
</code></pre>
<p>我会做的。你知道吗</p>