title: Python Regex to remove all line breaks to a single line
body: <p>I have an issue where line returns are causing an issue in my API calls and I want to make sure that line returns don't mess up my json formatting.</p>
  
  <p>The best way I could think of was to remove all line breaks to keep all text on a single line. I have tried ways like <code>re.sub(r'\s+', '',{{test\n\ntext\n\netc.}})</code> or replacing <code>\n</code> and <code>\r</code> but it results in text like</p>
  
  <p>test</p>
  
  <p>text</p>
  
  <p>etc.</p>
  
  <p>on separate lines. How can I adjust this to something like test | text | etc. ?</p>