Article 580JY [GNU grep] How to only get found pattern?

[GNU grep] How to only get found pattern?

by
littlebigman
from LinuxQuestions.org on (#580JY)
Hello,

I need to 1) download a web page and 2) parse it to find three items.

For some reason, GNU grep (2.5.4) doesn't return just what it found through the patterns:

Code:wget -O input.html https://www.acme.com/blah.html

grep -Poh "accountid=\"(\d+?)\" playerid=\"(.+?)\" videoid=\"(\d+?)\"" input.htmlThis returns...
Code:accountid="876450610001" playerid="AkdH379s6" videoid="6189413688001"... while I just need "876450610001 AkdH379s6 6189413688001".

Any idea?

Thank you.latest?d=yIl2AUoC8zA latest?i=QgpP4okfc60:nXhn0f3bSKY:F7zBnMy latest?i=QgpP4okfc60:nXhn0f3bSKY:V_sGLiP latest?d=qj6IDK7rITs latest?i=QgpP4okfc60:nXhn0f3bSKY:gIN9vFwQgpP4okfc60
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments