diff --git a/packages/validator/src/formats.ts b/packages/validator/src/formats.ts index 397f27cfaed..530eda1c390 100644 --- a/packages/validator/src/formats.ts +++ b/packages/validator/src/formats.ts @@ -8,17 +8,17 @@ export default { // IP address exclusion - private & local networks // Reference: https://www.arin.net/knowledge/address_filters.html - // filter 10.*.*.* and 127.*.*.* adresses + // filter 10.*.*.* and 127.*.*.* addresses '(?!(?:10|127)(?:\\.\\d{1,3}){3})' + // filter 169.254.*.* and 192.168.*.* '(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})' + // filter 172.16.0.0 - 172.31.255.255 - // TODO: add test to validate that it invalides address in 16-31 range + // TODO: add test to validate that it invalidates address in 16-31 range '(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})' + // IP address dotted notation octets // excludes loopback network 0.0.0.0 // excludes reserved space >= 224.0.0.0 - // excludes network & broacast addresses + // excludes network & broadcast addresses // (first & last IP address of each class) // filter 1. part for 1-223 @@ -56,8 +56,7 @@ export default { idcard: /^\d{15}$|^\d{17}(\d|x|X)$/, - money: - /^([\u0024\u00A2\u00A3\u00A4\u20AC\u00A5\u20B1\20B9\uFFE5]\s*)(\d+,?)+\.?\d*\s*$/, + money: /^([\u0024\u00A2\u00A3\u00A4\u20AC\u00A5\u20B1\u20B9\uFFE5]\s*)(\d+,?)+\.?\d*\s*$/, zh: /^[\u4e00-\u9fa5]+$/,