Started looking into regular expressions and I know some basics but now I tried to remove category and subcategory from a lot of Jekyll markdown files using regex. I succeeded to remove the two category lines but have some blank lines (\n) left.

**I would like to remove the blank lines between the hyphens (---).**

The current state looks like that (3 possible states):

```
---
title: safdsdf

---

```

or 

```
---
title: safdsdf

toc: 
---

```

or 

```
---
title: safdsdf

toc:
redirect_from: 
---

```

Using `(?!-\n)(\w)` I find the text but I am not able to get only the newlines. `(?!-{3}\n)(\n\n)` give me all newlines all over the document.
Regex are super-hard for me, any help is really appreciated.