Crop ASCII Art Challenge ASCII art is fun. Modern text editors are very good at manipulating text. Are modern programming languages up to the task? 

One common task in ASCII art manipulation is to crop text to a rectangle between two characters. This is the task you must implement in this challenge.

Details

Your program will take 3 inputs: 


the first is the 'start' character of the block - marking the top-left corner
the second is the 'end' character of the block - marking the bottom-right corner
the third is some form of multiline text, either a string, or list of strings, or filename, or whatever


The result will be multiline text (again, in any of the above formats) cropped to the rectangle between the given inputs. Note that the first two inputs may not be unique. 

Edge cases

Boxes must always have volume at least 2. Thus these:

()     (
       )


are boxes but these:

)(     )      (
       (     )


are not (with start=( and end=)).

The input will only contain one box. Thus the start and end characters must only occur once, unless they are the same character in which case they must occur exactly twice.

Additionally each line in the input must be at least as long as the distance from the start of a line to the right edge of the box in the input.

Your program does not need to handle invalid inputs; they may result in undefined behavior.

Rules

Typical code-golf rules apply. Shortest code wins.

Examples

Sunny-day: start: ( end: ) input:

This is some text
. (but this text
  is in a box  ).
So only it is important.


Output:

(but this text
is in a box  )


Note the stripping of horizontal space as well. ASCII art crops are 2d.

Rainy-day: start: ( end: ) input:

This is some text (
But is that even  )
really a box?


Output:

(
)


Same start/end: start: / end: / input:

Oh, I get how this could be useful
 /----------------------------\
 | All this text is in a box! |
 \----------------------------/


Output:

/----------------------------\
| All this text is in a box! |
\----------------------------/


Invalid input: start: ( end: ) input:

Boxes are rectangular ( so this has
0 volume ) which is illegal.


Invalid input 2: start: ( end: ) input:

(The lines must already be square 
so this line that is too short
relative to this end, is illegal)
Vim, 16, 12 bytes/keystrokes

#&lt;C-v&gt;Nj*yggVGp


Try it online! in the V interpreter


  Modern text editors are very good at manipulating text. Are modern programming languages up to the task?


I bet old text editors are even better! :D

Even though it doesn't necessarily have to, this answer does work with both of the given "invalid" inputs, outputting

 rectangular (
) which is ill


and 

(The lines must already be square
so this line that is too short
relative to this end, is illegal)


Explanation: 

#               " Move backward to the previous occurrence of the word (or in this case, character) under the cursor
 &lt;C-v&gt;          " Start a visual block selection
      N         " Go to the next occurrence of the last searched term (guaranteed to be line 1)
       j        " Move down a line
        *       " Move forward to the next occurrence of the character under the cursor
         y      " Yank (copy) the whole visually selected block
          gg    " Go to line 1
            VG  " Select every line
              p " And paste what we last copied over it, deleting the whole buffer and replacing it with the block