The following is my information:
The input:
\"button\" \"button\" href=\"#\" data-id=\"11111111111\" \"button\" \"button\" href=\"#\" data-id=\"222222222222\"
\"button\" \"button\" href=\"#\"
The output I'd like:
11111111111
222222222222
My 1st code which worked well:
text = 'data-id=\"11111111111 \" data-id=\"222222222222\" '
c = re.findall('data-id=\\"(.*?)\\"', text)
My 2nd code which doesn't work. It show nothing
with open("E:/test.txt","r") as f:
text = f.readline()
c = re.findall('data-id=\\"(.*?)\\"', text)
Why my secondary code doesn't work. Please help me fix it. I highly appreciate you. Thank you :)