Skip to content

Commit

Permalink
Allow dots in RegExp (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek authored Apr 17, 2024
1 parent c141778 commit 678952e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/banking/src/utils/validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ export const validateName: Validator<string> = value => {
// This regex was copied from the backend to ensure that the validation is the same
// Matches all unicode letters, spaces, dashes, apostrophes, commas, and single quotes
const isValid = value.match(
/^(?:[A-Za-zÀ-ÖÙ-öù-ƿDŽ-ʯʹ-ʽΈ-ΊΎ-ΡΣ-ҁҊ-Ֆա-ևႠ-Ⴥა-ჺᄀ-፜፩-ᎏᵫ-ᶚḀ-῾ⴀ-ⴥ⺀-⿕ぁ-ゖゝ-ㇿ㋿-鿯鿿-ꒌꙀ-ꙮꚀ-ꚙꜦ-ꞇꞍ-ꞿꥠ-ꥼA-Za-z]| |'|-|Ά|Ό|,)*$/,
/^(?:[A-Za-zÀ-ÖÙ-öù-ƿDŽ-ʯʹ-ʽΈ-ΊΎ-ΡΣ-ҁҊ-Ֆա-ևႠ-Ⴥა-ჺᄀ-፜፩-ᎏᵫ-ᶚḀ-῾ⴀ-ⴥ⺀-⿕ぁ-ゖゝ-ㇿ㋿-鿯鿿-ꒌꙀ-ꙮꚀ-ꚙꜦ-ꞇꞍ-ꞿꥠ-ꥼA-Za-z.]| |'|-|Ά|Ό|,)*$/,
);

if (!isValid) {
return t("common.form.invalidName");
}
};

//Beneficiary name input must accept numeric value, unlike other validation name
// Beneficiary name input must accept numeric value, unlike other validation name
export const validateBeneficiaryName: Validator<string> = value => {
if (!value) {
return t("common.form.required");
Expand All @@ -52,7 +52,7 @@ export const validateBeneficiaryName: Validator<string> = value => {

// Matches all unicode letters, spaces, dashes, apostrophes, commas, and single quotes
const isValid = value.match(
/^(?:[A-Za-zÀ-ÖÙ-öù-ƿDŽ-ʯʹ-ʽΈ-ΊΎ-ΡΣ-ҁҊ-Ֆա-ևႠ-Ⴥა-ჺᄀ-፜፩-ᎏᵫ-ᶚḀ-῾ⴀ-ⴥ⺀-⿕ぁ-ゖゝ-ㇿ㋿-鿯鿿-ꒌꙀ-ꙮꚀ-ꚙꜦ-ꞇꞍ-ꞿꥠ-ꥼA-Za-z]| |'|-|Ά|Ό|,|[1-9])*$/,
/^(?:[A-Za-zÀ-ÖÙ-öù-ƿDŽ-ʯʹ-ʽΈ-ΊΎ-ΡΣ-ҁҊ-Ֆա-ևႠ-Ⴥა-ჺᄀ-፜፩-ᎏᵫ-ᶚḀ-῾ⴀ-ⴥ⺀-⿕ぁ-ゖゝ-ㇿ㋿-鿯鿿-ꒌꙀ-ꙮꚀ-ꚙꜦ-ꞇꞍ-ꞿꥠ-ꥼA-Za-z.]| |'|-|Ά|Ό|,|[1-9])*$/,
);

if (!isValid) {
Expand Down

0 comments on commit 678952e

Please sign in to comment.