0
I know that I can find regex matches using egrep
.
My need is a bit more esoteric:
I need to list all regex matches, one per line of output.
So, assume a file containing the following:
This is just some sample 1text to illustrate the 2text seeker I had in mind.
As you can see in this 3text, I have many 4text matches, more than one 5text match per line of 6text.
With a regex of /[0-9]+text
/, I want the output to be:
1text
2text
3text
4text
5text
6text
Short of cobbling up a program to do just that, is there any way I can generate the wanted output using standard commands?
Oh. My. Gosh. How could I missed that?! Thanks! – pepoluan – 2016-06-25T11:38:22.997