Question: I've looked around StackExchange sites but I haven't found anything that's quite what I'm looking for. Here are two use cases of grep:

* Printing items before/after a match
* Print a certain match

I'm trying to parse a log file, and I want to return the last error in the log which is, predictably, at the end of the file. However, sometimes the errors are multiple lines. The answers for 'how to grep the last match' all involve either tail or head, and only work with a single line.

In my case, I want to simply return everything in the file, *starting with* the last match. Typically, this won't be any more than 10-15 lines maximum, so a `grep -A 15` does the trick there. But, I still need to only get the last one of these, so that alone doesn't produce the right output.

The naive approach is to use a two-part match, to first get what the last match is and then everything after that. This won't work for me, because I can't guarantee that the last match is unique.

Is it possible to do this with grep somehow, or would there be better tools for this?

Answer: 
img will target all images on page as you already experienced. You can use the different CSS selectors such as the class .rose for targeting the rose only. Since the cat is wrapped in a div with the ID of #yes, you can use that for targeting the cat only.

Here updated code:

```html
<style>

#yes:hover {
/* Start the shake animation and make the animation last for 0.5 seconds */
animation: shake 0.5s;
/* When the animation is finished, start again */
animation-iteration-count: infinite;
}
@keyframes shake {
0% { transform: translate(1px, 1px) rotate(0deg); }
10% { transform: translate(-1px, -2px) rotate(-1deg); }
20% { transform: translate(-3px, 0px) rotate(1deg); }
30% { transform: translate(3px, 2px) rotate(0deg); }
40% { transform: translate(1px, -1px) rotate(1deg); }
50% { transform: translate(-1px, 2px) rotate(-1deg); }
60% { transform
: translate(-3px, 1px) rotate(0deg); }
70% { transform: translate(3px, 1px) rotate(-1deg); }
80% { transform: translate(-1px, -1px) rotate(1deg); }
90% { transform: translate(1px, 2px) rotate(0deg); }
100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.rose {
position:absolute; 
height: 60px; 
position: absolute; 
right: 10%;
bottom: 65%; 
z-index: 10; 

}
</style>

<a href="link"><img class=rose src="https://lh3.googleusercontent.com/proxy/yE37tIxmy_UX0kF8GPWUE8IENQgG5N5LWThSxPW2Hf98oV2okclLeqBa9eoB8dafwEc2xryoRZZEdsyboPpFmz-NMi2nQOPhy2QU3hu5fJ5EBXCQOA_QpDnz"></a>

<div id="yes"><img src="https://media.tenor.com/images/eff22afc2220e9df92a7aa2f53948f9f/tenor.gif"></div>
```
```
img:hover

```

does effect all images on hover. So you have to seperate animations with different selectors. For example:

```
.rose:hover
.cat:hover 

```