As the title says I want to extract the text between two words. For that, it occurred to me to create a system with the command sed that would allow me to substitute what I was looking for then with greep and cut extract it. But the result has been in all cases an absolute failure, I put you a little in situation.
I have this text with a lot of code above and below:
<div class="item">
<div class="imagens">
<a href="http://sitio.php">
<img src="https://image.jpg" alt="texto" width="100%" height="100%"/></a>
<span class="imdb"><b><b class="icon-star"></b></b> 7.2</span>
</div>
<span class="text">texto</span>
<span class="fecha">2016</span>
</div>
<div class="item">
<div class="imagens">
<a href="http://sitio.php">
<img src="https://image.jpg" alt="texto" width="100%" height="100%"/></a>
<span class="imdb"><b><b class="icon-star"></b></b> 7.2</span>
</div>
<span class="text">texto</span>
<span class="fecha">2015</span>
</div>
EJ:
I parameterize these two texts " <div class="item"><div class="imagens">
" and this " </div>
" in such a way that there is a text like this:
<a href="http://sitio.php">
<img src="https://image.jpg" alt="texto" width="100%" height="100%"/></a>
<span class="imdb"><b><b class="icon-star"></b></b> 7.2</span>
</div>
<span class="text">texto</span>
<span class="fecha">2016</span>
EDITO
The answer of @Ivan Botero I think is the closest to solving the problem I have, but I still have the problem that I can not select the second </div>
you have.
And the labels that should not come out are:
<div class="item">
<div class="imagens">
and the second :
</div>
Because the first one is in the middle of the code, just behind the close span tag. Any help please?