title: Split long string into multiple lines regxp error
body: <p>I try to split a long string into multiple lines for output in react:</p>
  
  <pre><code>let text ='fooooooooooooooooooooooooooooooooooooooooooooooooooo'
  let rowEnd=10;
  let regxp = new RegExp(rowEnd, "g");
  let lines = text.match(regxp);
  text = lines.join("\n");
  console.log(text);
  </code></pre>
  
  <p>But getting an error: TypeError: Cannot read property 'join' of null.</p>
  
  <p>What am I doing wrong?</p>