mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-09 08:57:16 +08:00
fix: 正则表达式问题
This commit is contained in:
@@ -70,11 +70,20 @@ public class RegexConstants {
|
|||||||
* 域名、IPV4、IPV6
|
* 域名、IPV4、IPV6
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public static final String HTTP_HOST = """
|
public static final String HTTP_HOST =
|
||||||
^((?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}|
|
"^(" +
|
||||||
(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|
|
// ① 域名
|
||||||
(?:(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|
|
"(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}" +
|
||||||
""";
|
"|" +
|
||||||
|
// ② IPv4
|
||||||
|
"(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)" +
|
||||||
|
"|" +
|
||||||
|
// ③ IPv6(8 组 1-4 位十六进制,用 : 分隔,支持压缩 0)
|
||||||
|
"(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}" +
|
||||||
|
"|" +
|
||||||
|
// ④ IPv6 压缩形式(::)
|
||||||
|
"(?:[0-9A-Fa-f]{1,4}:){0,6}::(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4}" +
|
||||||
|
")$";
|
||||||
|
|
||||||
private RegexConstants() {
|
private RegexConstants() {
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user