8000 Enable _.words to detect ordinals in compound words. [closes #3561] · lodash/lodash@fa73d46 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fa73d46

Browse files
committed
Enable _.words to detect ordinals in compound words. [closes #3561]
1 parent b2ea6b1 commit fa73d46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.internal/unicodeWords.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const rsOptContrUpper = `(?:${rsApos}(?:D|LL|M|RE|S|T|VE))?`
3838
const reOptMod = `${rsModifier}?`
3939
const rsOptVar = `[${rsVarRange}]?`
4040
const rsOptJoin = `(?:${rsZWJ}(?:${[rsNonAstral, rsRegional, rsSurrPair].join('|')})${rsOptVar + reOptMod})*`
41-
const rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)'
42-
const rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)'
41+
const rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])'
42+
const rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])'
4343
const rsSeq = rsOptVar + reOptMod + rsOptJoin
4444
const rsEmoji = `(?:${[rsDingbat, rsRegional, rsSurrPair].join('|')})${rsSeq}`
4545

0 commit comments

Comments
 (0)
0