In a long document, I want to selectively delete the particular newlines that precede the exact string `\begin{enumerate*}`, ideally with a one-liner in bash or zsh.

That is, I want to convert **test.tex**:

```
Text in paragraphs.

More text

\begin{enumerate*} \item thing

```

to

```
Text in paragraphs.

More text \begin{enumerate*} \item thing

```

with a one-liner like

```
cat test.tex | perl -p -e 's/\n(?=(\\begin\{enumerate\*\}))/ /'

```

or 

```
cat test.tex | perl -p -e 's/\n\\begin\{enumerate\*\}/\\begin{enumerate*}/'

```

but I must be missing something because it doesn't make any change.

I also clearly don't need a regular expression here. If there's a way to do this with exact string matching instead of regex, I'd rather use that way. For instance, in R I could do this with `sub("\n\\begin{enumerate*}", "\\begin{enumerate*}", fixed = TRUE)`.