zotero-reference icon indicating copy to clipboard operation
zotero-reference copied to clipboard

[bug] DOI regex: illegal characters following doi links will be captured

Open e-zz opened this issue 2 years ago • 1 comments

https://github.com/MuiseDestiny/zotero-reference/blob/e8ac96c070db533b541ab681d23c79482b696304/src/modules/utils.ts#L11-L13

how to reproduce

It might catch illegal characters following doi (like the comma in https://doi.org/10.1016/j.physletb.2023.138153,)

possible solution

Maybe appending a \b is better.

 DOI: /10\.\d{4,9}\/[-\._;\(\)\/:A-z0-9><]+[^\.\]]\b/,

example

Check the example here https://regex101.com/r/Bbdv5J/1

potential related bugs

And maybe we'd better do the same with arxiv or url regex

e-zz avatar Oct 24 '23 14:10 e-zz

Thanks!!!

MuiseDestiny avatar Oct 25 '23 02:10 MuiseDestiny