Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Parts of a DOI:
* Directory Identifier: 10
* Registrant code: . + [0-9]{4,}
* Registrant code: . + [0-9]{2,}
* Registrant subdivision (optional): . + [0-9]+
* Suffix: / + any character, case insensitive for ASCII chars (but capitalised
* in the registry), with some characters that _should_ be escaped.
Expand All @@ -14,7 +14,7 @@

// TODO Capture final segment for fragments
// (\\.[a-zA-Z]{1}[0-9]{3})?
var doiRegex = '(10[.][0-9]{4,}(?:[.][0-9]+)*/(?:(?![%"#? ])\\S)+)'
var doiRegex = '(10[.][0-9]{2,}(?:[.][0-9]+)*/(?:(?![%"#? ])\\S)+)'
var doiTextPrefix = 'doi\\:'

var doi = module.exports = function (opts) {
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Parts of a DOI:
* Directory Identifier: 10
* Registrant code: . + [0-9]{4,}
* Registrant code: . + [0-9]{2,}
* Registrant subdivision (optional): . + [0-9]+
* Suffix: / + any character, case insensitive for ASCII chars (but capitalised
in the registry), with some characters that _should_ be escaped
Expand Down
3 changes: 2 additions & 1 deletion spec/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ var doi = [
'10.0001/journal.pone.000001',
'10.0001/journal/pone.0011111',
'10.0001.112/journal.pone.0011021',
'10.0001/issn.10001'
'10.0001/issn.10001',
'10.10.123/456'
]

var doiOlderFormat = [
Expand Down