Jul-05-2023, 06:28 AM
Hi,
I have this code below:
Import re
I have this code below:
Import re
Quote:text = """
ATT Please have a look at this building’s premium. It looks to be a very high rate. <img width="874" height="162" id="Picture_x0020_2" src="cid:[email protected]" alt="A picture containing text, screenshot, font, algebra
Description automatically generated" style="width:9.1in; height:1.6833in"> The client has a few policies with SEFATE as supporting business. 100000COUTINHO AC Family Trust (501 Missouri)StaHorse Sel: 000 4633353000e pos: [email protected] Lid van:Quanta Primary Ltd NSB Nr: 7777 Quanta Primary Ltd is an Authorised Financial Service Provider.
"""
pattern = re.compile(r'<img.+.+') matches = pattern.finditer(text) for match in matches: print(match)
Output:<re.Match object; span=(90, 239), match='<img width="874" height="162" id="Picture_x0020_2>
I wan to get this output:Output:<img width="874" height="162" id="Picture_x0020_2" src="cid:[email protected]" alt="A picture containing text, screenshot, font, algebra
Description automatically generated" style="width:9.1in; height:1.6833in">
Something is missing in my regular expression but I can't get it right.