diff --git a/packages/title-case/src/index.ts b/packages/title-case/src/index.ts index d9dfdd09..4a5347c8 100644 --- a/packages/title-case/src/index.ts +++ b/packages/title-case/src/index.ts @@ -1,9 +1,8 @@ const TOKENS = /(\S+)|(.)/g; -const IS_SPECIAL_CASE = /[\.#]\p{Alphabetic}/u; // #tag, example.com, etc. +const IS_SPECIAL_CASE = /[\.#][\p{L}\p{N}]/u; // #tag, example.com, etc. const IS_MANUAL_CASE = /\p{Ll}(?=[\p{Lu}])/u; // iPhone, iOS, etc. -const ALPHANUMERIC_PATTERN = /[\p{Alphabetic}\p{Nd}]+/gu; -const IS_ACRONYM = - /^(\P{Alphabetic})*(?:\p{Alphabetic}\.){2,}(\P{Alphabetic})*$/u; +const ALPHANUMERIC_PATTERN = /[\p{L}\p{N}]+/gu; +const IS_ACRONYM = /^([^\p{L}])*(?:\p{L}\.){2,}([^\p{L}])*$/u; export const WORD_SEPARATORS = new Set(["—", "–", "-", "―", "/"]);