Skip to content

Commit

Permalink
doaj: dois containing issn are not issn
Browse files Browse the repository at this point in the history
  • Loading branch information
miku committed Jan 31, 2020
1 parent 50296f5 commit 3d73abc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion formats/doaj/oaidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ func (record Record) JournalTitle() string {

// ISSN returns ISSN, if available.
func (record Record) ISSN() (issn []string) {
re := regexp.MustCompile(`[0-9]{4,4}-[0-9xX]{4,4}`)
// 10.1186/1471-230X-10-35, https://play.golang.org/p/-f0TVWQYjw5
re := regexp.MustCompile(`^[0-9]{4,4}-[0-9xX]{4,4}$`)
for _, v := range record.Metadata.Dc.Identifier {
v = strings.TrimSpace(v)
if len(v) == 8 {
v = v[:4] + "-" + v[4:]
}
if re.MatchString(v) {
issn = append(issn, v)
}
Expand Down

0 comments on commit 3d73abc

Please sign in to comment.