diff --git a/app/models/standard_identifiers.rb b/app/models/standard_identifiers.rb index 5588625..0de7f4c 100644 --- a/app/models/standard_identifiers.rb +++ b/app/models/standard_identifiers.rb @@ -33,7 +33,7 @@ def term_patterns { isbn: /\b(ISBN-*(1[03])* *(: ){0,1})*(([0-9Xx][- ]*){13}|([0-9Xx][- ]*){10})\b/, issn: /\b[0-9]{4}-[0-9]{3}[0-9xX]\b/, - pmid: /\b((pmid|PMID): (\d{7,8}))\b/, + pmid: /\b((pmid|PMID):\s?(\d{7,8}))\b/, doi: %r{\b10\.(\d+\.*)+/(([^\s.])+\.*)+\b} } end diff --git a/test/models/standard_identifiers_test.rb b/test/models/standard_identifiers_test.rb index 088c054..cdf8154 100644 --- a/test/models/standard_identifiers_test.rb +++ b/test/models/standard_identifiers_test.rb @@ -157,7 +157,7 @@ class StandardIdentifiersTest < ActiveSupport::TestCase end test 'pmid examples' do - samples = ['PMID: 35648703', 'pmid: 1234567'] + samples = ['PMID: 35648703', 'pmid: 1234567', 'PMID:35648703'] samples.each do |pmid| actual = StandardIdentifiers.new(pmid).identifiers