diff --git a/src/main/webapp/app/config/constants/regex.spec.ts b/src/main/webapp/app/config/constants/regex.spec.ts index 45841fbd4..7f511593a 100644 --- a/src/main/webapp/app/config/constants/regex.spec.ts +++ b/src/main/webapp/app/config/constants/regex.spec.ts @@ -60,6 +60,9 @@ describe('Regex constants test', () => { 'Test ΓΏ', "Test !@#$%^&*()_+[]{}|;:',.<>?", '1234567890', + 'test\ntest', + 'test\rtest', + 'test\r\ntest', ])('Truthy text: %s', text => { expect(VALID_LATIN_TEXT.test(text)).toBeTruthy(); }); diff --git a/src/main/webapp/app/config/constants/regex.ts b/src/main/webapp/app/config/constants/regex.ts index e5c1b3154..06b2481c7 100644 --- a/src/main/webapp/app/config/constants/regex.ts +++ b/src/main/webapp/app/config/constants/regex.ts @@ -3,6 +3,6 @@ // (PMID: 11753428, 16007150, 21467160) // (NCT1234567) export const REF_CAPTURE = /(\(\s*(?:PMID|NCT|Abstract):?.*?(?:\([^()]*\).*?)*\))/i; -export const VALID_LATIN_TEXT = /^[\p{Script=Latin}\p{M}\p{N}\p{Z}\p{P}\p{Sm}\p{Sc}\p{Sk}]+$/u; +export const VALID_LATIN_TEXT = /^[\p{Script=Latin}\p{M}\p{N}\p{Z}\p{P}\p{Sm}\p{Sc}\p{Sk}\r\n]+$/u; export const ALTERNATIVE_ALLELES_REGEX = /([A-Z]+[0-9]+)([A-Z]+(\/[A-Z]+)*)/i;