Hello all,
I am trying to pipe an output to something like sed
or awk
to parse it based on my delimiter. However, I am struggling with the fact that sed
reads line-by-line - so, my use of Regex is not effective.
Input
Some text I do not want
--fcc--
The text I do care about
--fcc--
Some more text I do not want
Output
The text I do care about
Note: I want to preserve spaces and tabs, and what-have-you within the delimiter bounds.
What I thought would work:
sed -E 's/[\s\S]+--fcc--([\s\S]+?)--fcc--[\s\S]+/\1/'
I have read through most of sed
's manual, and tried to make the Text search across multiple lines work, but do not understand it well enough I guess
Something to play with: https://replit.com/@Sky020/stdout-parsing#main.sh
Any help is appreciated