Class: Identifiers::PubmedId

Inherits:
Object
  • Object
show all
Defined in:
lib/identifiers/pubmed_id.rb

Class Method Summary collapse

Class Method Details

.extract(str) ⇒ Object



3
4
5
6
7
# File 'lib/identifiers/pubmed_id.rb', line 3

def self.extract(str)
  str
    .scan(/(?<=^|\s)0*(?!0)(\d+)(?=$|\s)/)
    .flatten
end