Skip to content

Commit

Permalink
feat: REGEX to allow long company names in BP invite (eclipse-tractus…
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanGerada3 authored Aug 19, 2024
1 parent bd07960 commit 194a81c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions src/types/Patterns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,23 @@ const TESTDATA = {
'BMW.Mini',
'BMW&Mini',
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'1234567890'.repeat(16),
'Bayerische Motoren Werke Aktiengesellschaft',
'7-ELEVEN INTERNATIONAL LLC',
'5N Plus Lübeck GmbH',
'Recht 24/7 Schröder Rechtsanwaltsgesellschaft mbH',
'+SEN Inc.', // leading special character
'La Poste S.A.',
'JPMORGAN ASIA-PACIFIC ADVANTAGE HYBRID FUND (QDII)',
'Currency £$€¥¢',
],
invalid: [
' BMW',
'BMW TG',
'BMW ',
'123',
'!#@',
'BMW/Mini]]',
'BMW]]',
'aaaaaaaaaaaa aaaaaaaaaaaaaaaaaa',
'Bayerische Motoren Werke Aktiengesellschaft\n', // newline
'W'.repeat(161), // 161 characters
'', // empty
],
},
CNAMES: {
Expand Down
2 changes: 1 addition & 1 deletion src/types/Patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Patterns = {
UUID: /^[a-f0-9]{8}(-[a-f0-9]{4}){4}[a-f0-9]{8}$/i,
EXTID: /^[a-z0-9]{6,36}$/i,
COMPANY_NAME:
/^\d*?[a-zÀ-ÿ]\d?([a-z0-9À-ÿ!?@&_£$€¥\-.,:;'()*+#%=]\s?){2,40}$/i,
/^(?!.*\s$)([\wÀ-ÿ£$€¥¢@%*+\-/\\,.:;=<>!?&^#'\x22()[\]]\s?){1,160}$/,
name: /^([A-Za-zÀ-ÿ-,.'](?!.*[-,.]{2})[A-Za-zÀ-ÿ-,.']{1,40} ?)[^ –]{1,40}$/,
zipcode: /^[A-Z0-9-]{1,8}$/,
streetNumber: /^[0-9A-Za-z- ]{1,20}$/,
Expand Down

0 comments on commit 194a81c

Please sign in to comment.