Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Python re.sub text manipulation on matched contents before substituting
Post: RE: Python re.sub text manipulation on matched con...

(May-16-2020, 05:04 AM)bowlofred Wrote: But it sounds like you want to modify data inside an HTML document, retaining the document. Trying to do that with regular expressions is tedious, and likely...
xilex General Coding Help 2 2,129 May-19-2020, 05:42 AM
    Thread: Python re.sub text manipulation on matched contents before substituting
Post: Python re.sub text manipulation on matched content...

Hi, I have the following code below: import re t = '<img data src="some-thing">' pattern = '(<img ).*?(src=")(.*?)(">)' u = re.sub(pattern, '\\1\\2\\3\\4', t) print(u)The output is <i...
xilex General Coding Help 2 2,129 May-16-2020, 02:35 AM

User Panel Messages

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