Question: I'm aware the general question must have been asked many times, but in attempting the suggested solutions I'm getting nowhere. I'd like to match either a new line character without a preceeding > or a new line character on it's own, but I can't seem to get any of the usual suggestions for matching a blank line to work.

Example (pcre):

```
/(([^>])\n|^\n)/$2<br>\n/g

```

In:

```
Hello World!

<tag>
text

```

Out Generated:

```
Hello World!<br>

<tag>
text<br>

```

Out Expected:

```
Hello World!<br>
<br>
<tag>
text<br>

```

Editable here:
<https://regex101.com/r/Vh30n9/4>

I believe I'm missing something fundamental, the knowledge of which would probably allow me to update the question title to be more specific and helpful to others.

Answer: 
Your regex is right, but your options are wrong. You just need to turn on the multiline option so that ^ matches beginning of line, instead of beginning of document. You have the "/g" global option on now, which is correct. You just need to add the "/m" also (so it ends up being "/gm").
Since your regex flavor is PCRE (PHP) you can also use a negative lookbehind for this:

Search for regex:

```
(?<!>)\n

```

and replace using:

```
<br>\n

```

[RegEx Demo](https://regex101.com/r/Vh30n9/6)

Here `(?<!>)` is negative lookbehind that asserts true only if there is no `>` character before `\n`.