Skip to content

Commit

Permalink
global: fix ADS detection
Browse files Browse the repository at this point in the history
* Fixes the ADS regex to support non-capitalized journals.
  • Loading branch information
slint authored and lnielsen committed Jun 1, 2018
1 parent d9dab1f commit f6420f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion idutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"""Matches new style arXiv ID, with an old-style class specification;
technically malformed, however appears in real data."""

ads_regexp = re.compile("(ads:|ADS:)?(\d{4}[A-Z]\S{13}[A-Z.:])$")
ads_regexp = re.compile("(ads:|ADS:)?(\d{4}[A-Za-z]\S{13}[A-Z.:])$")
"""See http://adsabs.harvard.edu/abs_doc/help_pages/data.html"""

pmcid_regexp = re.compile("PMC\d+$", flags=re.I)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_idutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
'http://www.ncbi.nlm.nih.gov/pmc/PMC2631623'),
('2011ApJS..192...18K', ['ads'], '',
'http://adsabs.harvard.edu/abs/2011ApJS..192...18K'),
('2016arXiv161002026S', ['ads'], '',
'http://adsabs.harvard.edu/abs/2016arXiv161002026S'),
('ads:2011ApJS..192...18K', ['ads'], '2011ApJS..192...18K',
'http://adsabs.harvard.edu/abs/2011ApJS..192...18K'),
('0000000218250097', ['orcid', 'isni'], '0000-0002-1825-0097',
Expand Down

0 comments on commit f6420f9

Please sign in to comment.