How to use the refextract.references.regexs.re_hdl.match function in refextract

To help you get started, we’ve selected a few refextract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inspirehep / refextract / refextract / references / engine.py View on Github external
def look_for_hdl_urls(citation_elements):
    """Looks for handle identifiers that have already been identified as urls

       When finding an hdl, creates a new HDL element.
       @param citation_elements: (list) elements to process
    """
    for el in citation_elements:
        if el['type'] == 'URL':
            match = re_hdl.match(el['url_string'])
            if match:
                el['type'] = 'HDL'
                el['hdl_id'] = match.group('hdl_id')
                del el['url_desc']
                del el['url_string']