本文共 994 字,大约阅读时间需要 3 分钟。
mediatek\frameworks\base\op\java\com\mediatek\op\util\DefaultPatterns.java
public static Pattern getWebUrl(final String engIriChar, final String goodIriChar, final String topLevelDomainStrForWebUrlExpand) { return Pattern.compile( "((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)" + "_" + "@)?)?" + "((?:(?:[" + engIriChar + "][" + engIriChar + ".)+" // named host + topLevelDomainStrForWebUrlExpand + "|(?:(?:25[0-5]|2[0-4]" // or ip address + "[0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]" + "|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1]" + "[0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}" + "|[1-9][0-9]|[0-9])))" + "(?:\\:\\d{1,5})?)" // plus option port number + "(\\/(?:(?:[" + goodIriChar + "~" // plus option query params + "}))*)?" + "(?:\\b|$)"); // and finally, a word boundary or end of // input. This is to stop foo.sure from // matching as foo.su 转载地址:http://ycedi.baihongyu.com/