sed print line from regex to regex

bash, regex, sed

Solution

If you want to print between the start and stop signs, try:

sed -n '/START/,/STOP/ { //!p }' file.txt

Results:

This
has
to
be
printed

Problem

I have a file with the following text: ``` text START This has to be printed STOP more text ``` Now i want the text in between START and STOP to be printed. I wrote the following: ``` cat file | sed '/START/,/STOP/p' ``` But that does not seem to be doing what i want. Any suggestions?

Original source