const mongoose = require('mongoose');

const Schema = mongoose.Schema;

const Descriptor = new Schema({
    name: {
        type: String,
        maxlength: 22,
        // [3 letter company] * [up to 18 letter product]
        // [7 letter company] * [up to 14 letter product]
        // [12 letter company] * [up to 9 letter product]
        match: /^([^\*]{3}\*.{1,18})|([^\*]{7}\*.{1,14})|([^\*]{12}\*.{1,9})$/,
    },
    phone: {
        type: String,
        maxlength: 14,
        minlength: 10,
        match: /[0-9\.\-]{10,14}/,
    },
    url: {
        type: String,
        maxlength: 13,
    },
}, { _id: false });

module.exports = Descriptor;

@@ -348,17 +348,16 @@
 h: /%5E(%5B%5E
-%5C
 *%5D%7B3%7D%5C*.
@@ -367,17 +367,16 @@
 18%7D)%7C(%5B%5E
-%5C
 *%5D%7B7%7D%5C*.
@@ -386,17 +386,16 @@
 14%7D)%7C(%5B%5E
-%5C
 *%5D%7B12%7D%5C*
@@ -517,11 +517,9 @@
 %5B0-9
-%5C.%5C
+.
 -%5D%7B1

Remove unneeded escapes