Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated regex for legal name and cardholder name #23650

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ const CONST = {
REGEX: {
SPECIAL_CHARS_WITHOUT_NEWLINE: /((?!\n)[()-\s\t])/g,
DIGITS_AND_PLUS: /^\+?[0-9]*$/,
ALPHABETIC_CHARS_WITH_NUMBER: /^[a-zA-ZÀ-ÿ0-9 ]*$/,
ALPHABETIC_AND_LATIN_CHARS: /^[a-zA-ZÀ-ÿ ]*$/,
POSITIVE_INTEGER: /^\d+$/,
PO_BOX: /\b[P|p]?(OST|ost)?\.?\s*[O|o|0]?(ffice|FFICE)?\.?\s*[B|b][O|o|0]?[X|x]?\.?\s+[#]?(\d+)\b/,
ANY_VALUE: /^.+$/,
Expand Down
4 changes: 2 additions & 2 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export default {
growlMessageOnSave: 'Your debit card was successfully added',
expensifyPassword: 'Expensify password',
error: {
invalidName: 'Name can only include latin letters and numbers.',
invalidName: 'Name can only include letters.',
addressZipCode: 'Please enter a valid zip code',
debitCardNumber: 'Please enter a valid debit card number',
expirationDate: 'Please select a valid expiration date',
Expand Down Expand Up @@ -784,7 +784,7 @@ export default {
error: {
dateShouldBeBefore: ({dateString}) => `Date should be before ${dateString}.`,
dateShouldBeAfter: ({dateString}) => `Date should be after ${dateString}.`,
hasInvalidCharacter: 'Name can only include latin letters and numbers.',
hasInvalidCharacter: 'Name can only include letters.',
incorrectZipFormat: ({zipFormat}) => `Incorrect zip code format.${zipFormat ? ` Acceptable format: ${zipFormat}` : ''}`,
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ export default {
growlMessageOnSave: 'Su tarteja de débito se agregó correctamente',
expensifyPassword: 'Contraseña de Expensify',
error: {
invalidName: 'El nombre solo puede contener números y caracteres latinos.',
invalidName: 'El nombre sólo puede incluir letras.',
addressZipCode: 'Por favor, introduce un código postal válido',
debitCardNumber: 'Por favor, introduce un número de tarjeta de débito válido',
expirationDate: 'Por favor, selecciona una fecha de vencimiento válida',
Expand Down Expand Up @@ -787,7 +787,7 @@ export default {
dateShouldBeBefore: ({dateString}) => `La fecha debe ser anterior a ${dateString}.`,
dateShouldBeAfter: ({dateString}) => `La fecha debe ser posterior a ${dateString}.`,
incorrectZipFormat: ({zipFormat}) => `Formato de código postal incorrecto.${zipFormat ? ` Formato aceptable: ${zipFormat}` : ''}`,
hasInvalidCharacter: 'El nombre solo puede contener números y caracteres latinos.',
hasInvalidCharacter: 'El nombre sólo puede incluir letras.',
},
},
resendValidationForm: {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ValidationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ function isValidDisplayName(name) {
* @returns {Boolean}
*/
function isValidLegalName(name) {
return CONST.REGEX.ALPHABETIC_CHARS_WITH_NUMBER.test(name);
return CONST.REGEX.ALPHABETIC_AND_LATIN_CHARS.test(name);
}

/**
Expand Down
Loading