title: Javascript split with substring and include said substring in the produced array
body: <p>I'm leveraging MathJax for a solution I'm building.  I'm using a placeholder—<code>\Box</code>—for a facts family equation.  I want to replace this placeholder when a solution based on a user's input.</p>
  
  <p>Okay, so my question, given strings like these:</p>
  
  <ul>
  <li><code>"\begin{array}{r} \Box\\ - \quad 7\\ \hline 6\end{array}"</code></li>
  <li><code>"\begin{array}{r} 12\\ - \quad \Box\\ \hline 1\end{array}"</code></li>
  <li><code>"\begin{array}{r} \Box\\ + \quad 1\\ \hline 6\end{array}"</code></li>
  <li><em>etc.</em></li>
  </ul>
  
  <p><code>\Box</code> can show up in different spots in the string as you can see. </p>
  
  <p><strong>The Goal</strong></p>
  
  <p>I would like to evaluate the MathJax string and find <code>\Box</code>.  Once I find it I want to split at that point and then build an array that also includes <code>\Box</code> as one of the items in the array at the point for which it was found.</p>
  
  <p><strong>Desired Outcome</strong></p>
  
  <pre><code>// With this string
      str = "\begin{array}{r} 12\\ - \quad \Box\\ \hline 1\end{array}"
  
  // Find and split on '/Box' and include it.
  
  // Desired Output
      ["\begin{array}{r} 12\\ - \quad ", "\Box", "\ \hline 1\end{array}"]
  </code></pre>
  
  <p>Any ideas would be much appreciated.</p>
  
  <p>Thank you in advance!</p>