Skip to content

Commit

Permalink
feat: extend legal entity pattern to support all language
Browse files Browse the repository at this point in the history
The legal entity pattern now supports and uses letter and currency unicode categories. This required update of ecma script to version 6.

Refs: eclipse-tractusx/portal#360
  • Loading branch information
typecastcloud committed Oct 1, 2024
1 parent 2e60493 commit 98648a0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/types/Patterns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,29 @@ const TESTDATA = {
'La Poste S.A.',
'JPMORGAN ASIA-PACIFIC ADVANTAGE HYBRID FUND (QDII)',
'Currency £$€¥¢',
'ACE 9 SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ',
'摩根亚太优势混合型证券投资基金 (QDII)',
'삼성', // Samsung
'三', // Samsung
'Czech: ČĎŇŘŠŤŽ',
'Estonian: ÄÖÜŠŽ',
'Slovak: ĽĹŔŠŤŽ',
'Polish: ĄĆĘŁŃÓŚŹŻ',
'Hungarian: ÁÉÍÓÖŐÚÜŰ',
'Romanian: ÂÎŞŢ',
'Bulgarian: ЙЪЬ',
'Greek: ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ',
'Turkish: ÇĞİıÖŞÜ',
'Arabic: ابتثجحخدذرزسشصضطظعغفقكلمنهوي',
'Hebrew: שלום עולם',
'Hindi: अआइईउऊऋएऐओऔकखगघङचछजझञटठडढणतथदधनपफबभमयरलवशषस',
'Tamil: அஆஇஈஉஊஎஏஐஒஓஔகஙசஞடணதநனபமயரலவழளஷஸஹ',
'Japanese: あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん',
'Chinese: 你好 世界',
'Korean: 안녕하세요 세계',
'Thai: สวัสดีชาวโลก', // Thai does not seem to work even with /p{L} and required additional range
'Vietnamese: ăâắáấàằầảẳẩãẵẫạặậđêéếèềẻểẽễẹệíìỉĩịôơóốớòồờỏổởõỗỡọộợưúứùừủửũữụựýỳỷỹỵ',
'Singapore: 你好 世界',
],
invalid: [
' BMW',
Expand Down
2 changes: 1 addition & 1 deletion src/types/Patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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:
/^(?!.*\s$)([\wÀ-ÿ£$€¥¢@%*+\-/\\,.:;=<>!?&^#'\x22()[\]]\s?){1,160}$/,
/^(?!.*\s$)([\p{L}\u0E00-\u0E7F\d\p{Sc}@%*+_\-/\\,.:;=<>!?&^#'\x22()[\]]\s?){1,160}$/u,
personName: personNamePattern,
name: /^([A-Za-z\u00C0-\u017F-,.'](?!.*[-,.]{2})[A-Za-z\u00C0-\u017F-,.']{0,40} ?)[^ –]{1,40}$/,
zipcode: /^[A-Z0-9-]{1,8}$/,
Expand Down

0 comments on commit 98648a0

Please sign in to comment.