def check_doi(doi):
 if (not doi):
  return None
 doi_check = re.search('10\\.\\d{4}/\\S+', doi)
 if (doi_check is not None):
  return doi_check.group()
 return None

def check_doi ( doi ) : if ( not doi ) : return None doi_check = re . search ( '10\\.\\d{4}/\\S+' , doi ) if ( doi_check is not None ) : return doi_check . group ( ) return None
check if something that looks like a doi is present anywhere in the string .