Skip to content

Commit

Permalink
Use \p{N}
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Sep 15, 2024
1 parent 976fa36 commit 8d4a028
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/title-case/src/index.ts
Original file line number Diff line number Diff line change
@@ -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(["—", "–", "-", "―", "/"]);

Expand Down

0 comments on commit 8d4a028

Please sign in to comment.