Add a DOI check function to metadata

This commit is contained in:
sengian 2014-02-16 21:27:21 +01:00
parent 434e36a8a7
commit 39d399b4b7

View File

@ -368,3 +368,11 @@ def format_isbn(isbn):
return '-'.join((i[:2], i[2:6], i[6:9], i[9]))
return '-'.join((i[:3], i[3:5], i[5:9], i[9:12], i[12]))
def check_doi(doi):
if not doi:
return None
doi_check = re.search(r'10\.\d{4}/\S+', doi)
if doi_check is not None:
return doi_check.group()
return None