Skip to content

Commit

Permalink
fix: error matching in phrase regex
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleSound committed Jul 11, 2024
1 parent f757327 commit c77ea9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { config, isPhraseExcluded } from '~/config'

export function *extractPhrases(text: string) {
// Here we create a regex inside the closure to avoid `lastIndex` pollution across iterations
const regex = /[\w|-]{2,}/g
const regex = /[\w-]{2,}/g
let match: RegExpExecArray | null
regex.lastIndex = 0

Expand Down

0 comments on commit c77ea9d

Please sign in to comment.