How to use regex with multiple data formats
<p>I'm trying to extract reference CVEs from a website that I monitor.  My regex code was working when the format on row0 was like this -- (Ref. #8957501) (CVE-2015-3600), but it broke when the format changed to this -- (Ref #555237/92073/CVE-2015-9042)  </p>

<p>How do I extract the CVE string using both formats?</p>

<p>Here is my current regex code:</p>

<pre><code>cve_pattern = re.compile(r'(CVE-1999-\d{4,7}|CVE-(200[0-9])-\d{4,7}|CVE-(201[0-9])-\d{4,7})', re.IGNORECASE)
    for cve_number_pattern_match in cve_pattern.finditer(row[0]):
        if cve_number_pattern_match is not None:
            logger.info(cve_number_pattern_match.group(0) + " is located on row " + str(row_num))
            cve_number_list[row_num] = cve_number_pattern_match.group(0)
</code></pre>