Remove very specific whitespace combination from string

I have an input string that I need to remove a very specific combination of whitespace characters from and I cannot figure out how to create a regex that will remove only this specific combination of characters. I have lost track of the different regex combination I have tried off and on over the past few weeks.

The format of the string I’m trying to remove is “{space}{space}{newline}{newline}{space}{space}{newline}”. It can be seen in the HTML snippet below.

<div class="row">
+ Process products in strict compliance with cGMP and SOPs.
  

  
+ Operate and maintain production equipment.
  

  
+ Participate in all production activities, including manufacturing, packaging, punching, and pouching of products.
  

  
+ Clean equipment and manufacturing room in compliance with established policies and regulatory requirements.
</div>

The expected output should be this:

<div class="row">
+ Process products in strict compliance with cGMP and SOPs.
+ Operate and maintain production equipment.
+ Participate in all production activities, including manufacturing, packaging, punching, and pouching of products.
+ Clean equipment and manufacturing room in compliance with established policies and regulatory requirements.
</div>

Hopefully someone can help me.

Answer

Something like this?

const div = document.querySelector(".row")
let text = div.textContent;
div.innerHTML = text.replace(/(s+)?n(s+)?/g,"<br>")
.row { whitespace: pre }
<div class="row">
+ Process products in strict compliance with cGMP and SOPs.
  

  
+ Operate and maintain production equipment.
  

  
+ Participate in all production activities, including manufacturing, packaging, punching, and pouching of products.
  

  
+ Clean equipment and manufacturing room in compliance with established policies and regulatory requirements.
</div>