I have a large text file that is all one line. In the text are several sections that looks like
foo=12345 and I need to extract them all as separate lines, ignoring the rest of the file.
random junk foo=12345 more junk random junk foo=2345 junk foo=7654 junk random foo=5432 junk
What I want to get out is:
12345 2345 7654 5432
I know how to write the regex to extract the
foo=([0-9]+), but I'm not sure how to apply that to the text and get the lines out in bash.