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

feat: REGEX to allow long company names in BP invite #1007

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
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
Loading