diff --git a/dist/686C-674-schema.json b/dist/686C-674-schema.json index fa316c6f3..a777660bb 100644 --- a/dist/686C-674-schema.json +++ b/dist/686C-674-schema.json @@ -10,18 +10,18 @@ "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$" + "pattern": "^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$" }, "middle": { "type": "string", - "pattern": "^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$", + "pattern": "^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$", "maxLength": 20 }, "last": { "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$" + "pattern": "^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$" } }, "required": [ diff --git a/package.json b/package.json index eeaeabcf5..fae2336cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vets-json-schema", - "version": "20.32.3", + "version": "20.32.4", "repository": { "type": "git", "url": "git+https://github.com/department-of-veterans-affairs/vets-json-schema.git" diff --git a/src/schemas/686c-674/schema.js b/src/schemas/686c-674/schema.js index a081a0102..dbb0749a7 100644 --- a/src/schemas/686c-674/schema.js +++ b/src/schemas/686c-674/schema.js @@ -12,14 +12,14 @@ const currencyAmountPattern = '^\\d+(\\.\\d{1,2})?$'; // filter out military states const militaryStates = ['AA', 'AE', 'AP']; const filteredStates = states.USA.filter(state => !militaryStates.includes(state.value)); -const textRegex = '^(?!\\s)(?!.*?\\s{2,})[^<>%$#@!^&*0-9]+$'; +const nameRegex = '^[A-Za-zÀ-ÖØ-öø-ÿ-]+(?:s[A-Za-zÀ-ÖØ-öø-ÿ-][?]+)*$'; let definitions = cloneDeep(commonDefinitions); definitions = pick(definitions, 'fullName', 'phone', 'date', 'email', 'files', 'privacyAgreementAccepted', 'ssn'); -definitions.fullName.properties.first.pattern = textRegex; -definitions.fullName.properties.last.pattern = textRegex; -definitions.fullName.properties.middle.pattern = textRegex; +definitions.fullName.properties.first.pattern = nameRegex; +definitions.fullName.properties.last.pattern = nameRegex; +definitions.fullName.properties.middle.pattern = nameRegex; definitions.fullName.properties.first.maxLength = 30; definitions.fullName.properties.last.maxLength = 30; definitions.fullName.properties.middle.maxLength = 20;