Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression
#5
pattern = re.compile(r'<img.+.+')
matches = pattern.finditer(text, re.DOTALL)

for match in matches:
    print(match.group(0))
Nothing still, I still get the same part of output, not all.

I'm getting:
Output:
<img width="874" height="162" id="Picture_x0020_2" src="cid:[email protected]" alt="A picture containing text, screenshot, font, algebra
And I'm looking for this:
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">
Reply


Messages In This Thread
Regular Expression - by stahorse - Jul-05-2023, 06:28 AM
RE: Regular Expression - by Gribouillis - Jul-05-2023, 07:46 AM
RE: Regular Expression - by stahorse - Jul-05-2023, 09:21 AM
RE: Regular Expression - by Gribouillis - Jul-05-2023, 11:51 AM
RE: Regular Expression - by stahorse - Jul-05-2023, 12:10 PM
RE: Regular Expression - by DeaD_EyE - Jul-05-2023, 01:18 PM
RE: Regular Expression - by Will_Robertson - Jul-31-2023, 01:20 PM
RE: Regular Expression - by stahorse - Jul-05-2023, 02:46 PM
RE: Regular Expression - by stahorse - Jul-11-2023, 10:12 AM
RE: Regular Expression - by deanhystad - Jul-12-2023, 11:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  regular expression pramod 1 1,609 Jul-10-2020, 06:38 AM
Last Post: karkas
  regular expression pramod 6 3,162 Jul-04-2020, 04:58 AM
Last Post: pramod
  regular expression pramod 4 2,170 Jun-16-2020, 02:01 AM
Last Post: pramod
  regular expression pramod 2 1,691 May-05-2020, 02:36 AM
Last Post: pramod

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020