擅长:python、mysql、java
<p>使用正则表达式:</p>
<pre><code>>>> import re
>>> re.match(r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.*', 'http://95.154.196.187/broser/6716804bc5a91f707a34479012dad47c/')
<_sre.SRE_Match object at 0x7f4412043440>
>>> re.match(r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.*', 'http://paypal.com.cgi-bin-websc5.b4d80a13c0a2116480.ee0r-cmd-login-submit-dispatch-')
>>>
</code></pre>
<p>对于更细粒度的regex外观<a href="https://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address">here</a>。在</p>