Skip to content

Commit

Permalink
Merge pull request #1156 from zhx828/hotfix
Browse files Browse the repository at this point in the history
Allow new line in text validation
  • Loading branch information
zhx828 authored Sep 25, 2024
2 parents 7b15ec3 + cc3fd60 commit c32b9ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/webapp/app/config/constants/regex.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/config/constants/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit c32b9ad

Please sign in to comment.