title: Regex to capture everything before pattern in Google Sheets
body: <p>I’m having a hard time figuring out the regex code in Google Sheets to check a cell then return everything including new lines <code>\n</code> and returns <code>\r</code> before a certain pattern <code>\*+</code>. </p>
  
  <p>A little more background: I'm using <code>REGEXEXTRACT(A:A,"...")</code> format inside a bigger <code>ArrayFormula</code> so that it automatically updates when a new row is added. This one’s working properly. It’s only the regex part I’m having trouble with. </p>
  
  <p>So, for the purpose of this question, let's say I'm only worried about extracting the data from the A1 cell before a certain pattern and return that value in cell B1. Which brings us to this code in cell B1: </p>
  
  <p><code>REGEXEXTRACT(A1,"...")</code></p>
  
  <p>For example, this is how my A1 cell looks like:</p>
  
  <pre><code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus accumsan risus id ex dapibus sodales. 
  
  Curabitur dui lacus, tincidunt vel ligula quis, volutpat mattis eros. 
  
  In quis metus at ex auctor lobortis. Aliquam sed nisi purus. Sed cursus odio erat, ut tristique sapien interdum interdum. Morbi vel sollicitudin ante, non pellentesque libero. 
  
  ***********
  
  Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean egestas urna facilisis massa posuere, quis accumsan erat ornare. 
  
  Curabitur at dapibus nibh. Nam nec vestibulum ligula. Phasellus bibendum mi urna, ac hendrerit libero interdum non. Suspendisse semper non elit aliquam auctor. 
  
  Morbi vel sem tortor. Donec a sapien quis erat condimentum consequat in ut sem. Quisque in tellus sed est lobortis ultricies sed vitae enim.
  </code></pre>
  
  <p>I want to return this value in B1:</p>
  
  <pre><code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus accumsan risus id ex dapibus sodales. 
  
  Curabitur dui lacus, tincidunt vel ligula quis, volutpat mattis eros. 
  
  In quis metus at ex auctor lobortis. Aliquam sed nisi purus. Sed cursus odio erat, ut tristique sapien interdum interdum. Morbi vel sollicitudin ante, non pellentesque libero. 
  </code></pre>
  
  <p>Which is basically anything before the pattern <code>*******</code>. In Python, I can add the <code>re.DOTALL</code> to the <code>.*</code> but I can't get this to work in Google Sheets. </p>