Skip to content

Commit

Permalink
fixed regex which got stuck on pathological cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nleanba committed Sep 27, 2024
1 parent 84a98fd commit 88f0430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gg2rdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ export function gg2rdf(
if (!a) return "";
let result = normalizeSpace(a)
.replace(
/\s*,?\s*(\(?[0-9]{4}\)?)\s*[a-z]*\s*:?(?:\s*[0-9]*\s*[a-z-]*\s*,?)*(\)?)\s*$/,
/\s*,*\s*(\(?[0-9]{4}?)[^\)]*(\)?).*$/,
", $1$2",
)
.replaceAll('"', "")
Expand Down

0 comments on commit 88f0430

Please sign in to comment.