# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(?!<a[^>]*?>)(?!<span[^>]*?>)(\bASIC\b)(?![^<]*?<\/span)(?![^<]*?<\/a)"
test_str = ("<h2 class=\"h3 font-weight-bold iag-purple\">The fees and costs disclosure ASIC requirements</h2><div class=\"iag-main-content\"><div><ol style=\" \" start=\"4\"><li style=\" \"><span>Issuers must meet certain requirements for disclosing fees and costs in PDSs and periodic statements under:</span><ol style=\" list-style-type:lower-latin\"><li style=\" padding-left:4.51pt\"><span>the PDS regime in Pt 7.9 of the Corporations Act and the <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"Sch 10 to the Corporations Regulations, as inserted by the Corporations Amendment Regulations 2005 (No. 1) \"><strong>enhanced fee disclosure regulations</strong></span> in Sch 10 to the <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"Corporations Regulations 2001 \"><strong>Corporations Regulations</strong></span> (see </span><span>RG 97.8</span><span>–</span><span>RG 97.11</span><span>). These were modified by</span><a href=\"https://www.legislation.gov.au/Details/F2016C01089\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff; -aw-import:spaces\"></span><span style=\"text-decoration:underline; color:#0000ff\">[CO 14/1252], </span></a><span>as amended by </span><a href=\"https://www.legislation.gov.au/Details/F2015L01835\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff; -aw-import:spaces\"></span><span style=\"text-decoration:underline; color:#0000ff\">ASIC Corporations (Amendment and Repeal) Instrument</span></a><a href=\"https://www.legislation.gov.au/Details/F2015L01835\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff; -aw-import:spaces\"></span><span style=\"text-decoration:underline; color:#0000ff\">2015/876 </span></a><span>and </span><a href=\"https://www.legislation.gov.au/Details/F2016L02013\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff; -aw-import:spaces\"></span><span style=\"text-decoration:underline; color:#0000ff\">ASIC Corporations (Amendment) Instrument 2016/1224,</span></a><span> which clarifies certain fee and cost disclosure requirements for PDSs and periodic statements; and</span></li><li style=\" padding-left:4.51pt\"><span>the <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"A PDS that is required to comply with the shorter PDS regime \"><strong>shorter PDS</strong></span> regime in Pt 7.9 of the Corporations Act (as modified by </span><span>Subdivs</span><span> 4.2–4.2C of Pt 7.9 of the Corporations Regulations) and </span><span>Schs</span><span> 10D and 10E to the Corporations Regulations (see </span><span>RG 97.12</span><span>–</span><span> RG 97.14</span><span>).</span><br><br><span style=\"font-weight:bold\">Note:</span><span> The shorter PDS regime imposes a modified version of the enhanced fee disclosure regulations. It applies to issuers of most <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"A superannuation interest within the meaning of the SIS Act \"><strong>superannuation products</strong></span> and some simple managed investment schemes.</span></li></ol></li><li style=\" \"><span>The enhanced fee disclosure regulations were introduced in 2005 and amended as part of the Stronger Super reforms for superannuation products: see </span><span>RG 97.15</span><span>–</span><span>RG 97.16. ASIC </span></li><li style=\" \"><a href=\"https://www.legislation.gov.au/Details/F2015C00982\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff\">Class Order [CO 13/763] </span></a><span style=\"font-style:italic\">Investor directed portfolio services </span><span>requires an <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"Investor directed portfolio service \"><strong>IDPS</strong></span> guide to provide disclosure in relation to the interests in the IDPS in accordance with Sch 10 to the Corporations Regulations, as if the interests were managed investment products. </span><a href=\"https://www.legislation.gov.au/Details/F2016L01565\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff\">ASIC Corporations (Managed</span></a><span> </span><a href=\"https://www.legislation.gov.au/Details/F2016L01565\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff\">Discretionary Account Services) Instrument 2016/968 </span></a><span>requires the Financial Service Guide for MDA services to provide information in relation to the MDA services in accordance with Pt 2 of Sch 10 as if the clients were being offered a <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"An interest in a registered scheme, a legal or equitable right in such an interest, or an option to acquire by way of issue such an interest or right \"><strong>managed investment product</strong></span> from 1 October 2017, unless there is an earlier opt in under that instrument.</span></li><li style=\" \"><span>Generally, a PDS must be up to date when it is given to a retail investor. </span><a href=\"https://www.legislation.gov.au/Details/F2016L01769\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff\">ASIC Corporations (Updated Product Disclosure Statements) Instrument</span></a><span> </span><a href=\"https://www.legislation.gov.au/Details/F2016L01769\" style=\"text-decoration:none\" target=\"_blank\"><span style=\"text-decoration:underline; color:#0000ff\">2016/1055 </span></a><span>provides relief ASIC for the <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"The person who makes available the financial product. For a superannuation product, this is the trustee of the superannuation ASIC entity and, for an interest in a registered scheme, this is the responsible entity of the scheme \"><strong>issuer</strong></span> from updating the PDS for information that is not materially ASIC adverse under certain conditions.</span></li></ol>\n"
"<h3>Bla Bla Bla ASIC blab</h3>\n"
"<h4>Bla Bla Bla ASIC blab</h4>\n"
"<h5>Bla Bla Bla ASIC blab</h5>\n"
"<h6>Bla Bla Bla ASIC blab</h6>\n"
"<h7>Bla Bla Bla ASIC blab</h7>")
matches = re.finditer(regex, test_str)
for matchNum, match in enumerate(matches, start=1):
print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
for groupNum in range(0, len(match.groups())):
groupNum = groupNum + 1
print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html