I need to check if "slave=new" string exists below the string "localhost" in a specific pattern. The example of the pattern is shown below. The idea is to start checking from "localhost" string and end up before ";;" delimiter ?
I figured way to check if "slave=new" is on second row after localhost,

```
grep -A1 "localhost" file| tail -1

```

but there is possibility to be placed on the rest of the rows before ";;".

Here's the pattern: 

```
(frasdsp221)
   slave=new
   blablabla
   tintirimintiri
;;

  (localhost)
   blobloblo
   slave=new
   blablabla
;;

  (asdasd421)
   slave=new
   blablabla
   tintirimintiri
;;

```