Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在尝试编写一个正则表达式来匹配网站的 URL。显然
(http:\/\/www.)([a-zA-Z0-9])(\.[a-zA-z])\/"\s
不起作用。URL 必须以http://www.并且最多可以包含一个或多个字母数字字符。
http://www.
输入谷歌怎么样:“正则表达式url”并点击第一个结果?
url 的正则表达式
使用 Apache Commons 的 UrlValidator:
http://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validator/UrlValidator.html