Skip to content

Commit

Permalink
fix: correct indian rupee regexp (#2714)
Browse files Browse the repository at this point in the history
  • Loading branch information
catchonme authored Jan 19, 2022
1 parent 72f6560 commit b226901
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/validator/src/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]+$/,

Expand Down

0 comments on commit b226901

Please sign in to comment.