Commit 11fcd080 authored by Dietmar Maurer's avatar Dietmar Maurer

IP4_cidr_match: allow short masks like /8

parent 0d8559d0
...@@ -28,7 +28,7 @@ var IPV6_H16 = "(?:[0-9a-fA-F]{1,4})"; ...@@ -28,7 +28,7 @@ var IPV6_H16 = "(?:[0-9a-fA-F]{1,4})";
var IPV6_LS32 = "(?:(?:" + IPV6_H16 + ":" + IPV6_H16 + ")|" + IPV4_REGEXP + ")"; var IPV6_LS32 = "(?:(?:" + IPV6_H16 + ":" + IPV6_H16 + ")|" + IPV4_REGEXP + ")";
var IP4_match = new RegExp("^(?:" + IPV4_REGEXP + ")$"); var IP4_match = new RegExp("^(?:" + IPV4_REGEXP + ")$");
var IP4_cidr_match = new RegExp("^(?:" + IPV4_REGEXP + ")\/[1-3][0-9]?$"); var IP4_cidr_match = new RegExp("^(?:" + IPV4_REGEXP + ")\/[1-3]?[0-9]$");
var IPV6_REGEXP = "(?:" + var IPV6_REGEXP = "(?:" +
"(?:(?:" + "(?:" + IPV6_H16 + ":){6})" + IPV6_LS32 + ")|" + "(?:(?:" + "(?:" + IPV6_H16 + ":){6})" + IPV6_LS32 + ")|" +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment